Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor/#275]: 인덱스 제약 수정 및 추가 #294

Merged
merged 6 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.few.api.repo.dao.member.MemberDao
import com.few.api.repo.dao.member.command.InsertMemberCommand
import com.few.api.repo.dao.member.command.UpdateDeletedMemberTypeCommand
import com.few.api.repo.dao.member.command.UpdateMemberTypeCommand
import com.few.api.repo.dao.member.query.BrowseWorkbookWritersQuery
import com.few.api.repo.dao.member.query.SelectMemberByEmailQuery
import com.few.api.repo.dao.member.query.SelectWriterQuery
import com.few.api.repo.dao.member.support.WriterDescription
Expand Down Expand Up @@ -88,6 +89,17 @@ class MemberDaoExplainGenerateTest : JooqTestSpec() {
ResultGenerator.execute(query, explain, "selectWritersQueryExplain")
}

@Test
fun selectWritersQueryExplainByWorkbookIds() {
val query = BrowseWorkbookWritersQuery(listOf(2L, 3L)).let {
memberDao.selectWritersQuery(it)
}

val explain = dslContext.explain(query).toString()

ResultGenerator.execute(query, explain, "selectWritersQueryExplainByWorkbookIds")
}

@Test
fun selectMemberByEmailQueryExplain() {
val query = SelectMemberByEmailQuery("[email protected]").let {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- Subscription의 unique constraint를 삭제합니다.
ALTER TABLE SUBSCRIPTION
DROP CONSTRAINT subscription_unique_member_id_target_member_id;

ALTER TABLE SUBSCRIPTION
DROP CONSTRAINT subscription_unique_member_id_target_workbook_id;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Subscription의 target_workbook_id에 대한 index를 추가합니다.
CREATE INDEX subscription_target_workbook_idx
ON SUBSCRIPTION (target_workbook_id);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Subscription의 member_id에 대한 index를 추가합니다.
CREATE INDEX subscription_member_idx
ON SUBSCRIPTION (member_id);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Workbook의 category_cd를 위한 인덱스 추가
CREATE INDEX workbook_category_idx
ON WORKBOOK (category_cd);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- MAPPING_WORKBOOK_ARTICLE 테이블에 인덱스 추가
CREATE INDEX mapping_workbook_article_workbook_id_idx
ON MAPPING_WORKBOOK_ARTICLE (workbook_id);
Loading