Skip to content

Board Service - getNoticeItems, getItems Method 에서 발생하는 n+1 문제를 해결합니다. #327

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

Open
xharpenParksuhyeon opened this issue Dec 21, 2021 · 0 comments
Assignees
Milestone

Comments

@xharpenParksuhyeon
Copy link
Member

getNoticeItems, getNoticeItems Method 에서 발생하는 User 모델에 대한 n+1 문제을 해결해줍니니다.


with 을 사용하지 않는 상태….

페이지 Execute Query Count: Memory Usage Request Duration Query Duration
게시판 Show 페이지 57 12MB 132ms 21.57ms

져온 게시물 갯수만큼 해당 쿼리가 추가로 실행되고 있습니다.

select * from `xe_user` where `xe_user`.`id` = '' and `xe_user`.`id` is not null limit

with 을 사용한 상태…

페이지 Execute Query Count: Memory Usage Request Duration Query Duration
게시판 Show 페이지 49 12MB 128ms 18.24ms

with 구문을 사용해 user 모델애 대한 n + 1 문제를 해결했습니다.

select * from `xe_user` where `xe_user`.`id` in ('게시판 아이디 ...')
@xharpenParksuhyeon xharpenParksuhyeon added this to the 1.0.14 milestone Dec 21, 2021
@xharpenParksuhyeon xharpenParksuhyeon self-assigned this Dec 21, 2021
xharpenParksuhyeon added a commit that referenced this issue Dec 21, 2021
@xharpenParksuhyeon xharpenParksuhyeon changed the title getNoticeItems, getNoticeItems Method 에서 발생하는 user 모델에 대한 n+1 문제를 해결합니다. getNoticeItems, getNoticeItems Method 에서 발생하는 n+1 문제를 해결합니다. Dec 22, 2021
@xharpenParksuhyeon xharpenParksuhyeon changed the title getNoticeItems, getNoticeItems Method 에서 발생하는 n+1 문제를 해결합니다. getNoticeItems, getItemsMethod 에서 발생하는 n+1 문제를 해결합니다. Dec 22, 2021
@xharpenParksuhyeon xharpenParksuhyeon changed the title getNoticeItems, getItemsMethod 에서 발생하는 n+1 문제를 해결합니다. Board Service - getNoticeItems, getItems Method 에서 발생하는 n+1 문제를 해결합니다. Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant