Skip to content
New issue

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

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

Already on GitHub? # to your account

[Refactor] Notice테이블에 복합인덱스 추가하기 #186

Open
zbqmgldjfh opened this issue Jun 7, 2024 · 1 comment
Open

[Refactor] Notice테이블에 복합인덱스 추가하기 #186

zbqmgldjfh opened this issue Jun 7, 2024 · 1 comment
Assignees
Labels
🔥 Enhancement New feature or request

Comments

@zbqmgldjfh
Copy link
Member

지금까지 notice table에 기본적으로 mysql에 의해 생성되는 primary key index말고, 별도의 검색을 위한 인덱스가 있다고 생각하고 있었다....

우리가 지금 사용하는 쿼리를 explain해보면

explain
select n.article_id, n.posted_dt, n.url, n.subject, n.category_name, n.important
from notice as n
where n.category_name = 'BACHELOR'
order by n.posted_dt desc
limit 10 offset 0;
image

category_name과 posted_dt를 사용하는 복합인덱스가 있으면 매우 적절할것같다!
하지만 현실은 없었던....

image

이를 추가하자!!

@zbqmgldjfh zbqmgldjfh added the 🔥 Enhancement New feature or request label Jun 7, 2024
@zbqmgldjfh zbqmgldjfh self-assigned this Jun 7, 2024
@zbqmgldjfh
Copy link
Member Author

아 아닌가?... 잘못 생각한듯??

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
🔥 Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant