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

limit 최적화 처리 필요 #51

Open
myyrakle opened this issue Sep 25, 2022 · 0 comments
Open

limit 최적화 처리 필요 #51

myyrakle opened this issue Sep 25, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@myyrakle
Copy link
Owner

myyrakle commented Sep 25, 2022

  1. 현재는 full scan을 할때 limit 1이 걸려있더라도 row를 전부 가져온 다음 마지막에야 필터 처리를 하고 있음
  2. 추후에는, join이나 별도 조건이 없을 경우엔 full scan 자체에서 limit을 걸어 불필요한 낭비를 줄일 필요 있음
select * from foo limit 1 // 무조건 하나만 스캔
select * from foo offset 5 limit 1 //6개만 스캔해도 될듯.
select * from foo order by a limit 1 //풀스캔 필요 (order by에 인덱스가 없을 경우에만)
select * from foo f inner join bar b as f.id = b.id limit 1 //풀스캔 필요
@myyrakle myyrakle added the enhancement New feature or request label Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant