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

Explore alternative methods of SQL pagination for speed #138

Open
anthonyfok opened this issue Oct 22, 2021 · 0 comments · May be fixed by #140
Open

Explore alternative methods of SQL pagination for speed #138

anthonyfok opened this issue Oct 22, 2021 · 0 comments · May be fixed by #140
Assignees
Labels
Enhancement New feature or request

Comments

@anthonyfok
Copy link
Member

I finally tried to build the whole stack again (after a very long hiatus), and was pleasantly surprised by how smoothly it ran. The almost-out-of-memory-computer-slowed-to-a-crawl is no more, and eventually came to completion Thank you @drotheram!)

So, I finally googled for "LIMIT and OFFSET" to learn about this magic trick of reducing memory usage, and came across the following articles:

So, it seems that as the OFFSET increases, each SQL query becomes more time-consuming. "Cursor" is suggested as an alternative, and indeed, it seems Psycopg has support for cursors:

Hope the use of cursor is indeed faster!

@anthonyfok anthonyfok added the Enhancement New feature or request label Oct 22, 2021
@anthonyfok anthonyfok added this to the Sprint 45 milestone Oct 22, 2021
@anthonyfok anthonyfok self-assigned this Oct 22, 2021
anthonyfok added a commit to anthonyfok/opendrr-api that referenced this issue Oct 22, 2021
anthonyfok added a commit to anthonyfok/opendrr-api that referenced this issue Oct 22, 2021
anthonyfok added a commit to anthonyfok/opendrr-api that referenced this issue Oct 22, 2021
@anthonyfok anthonyfok modified the milestones: Sprint 45, Sprint 46 Nov 8, 2021
@anthonyfok anthonyfok modified the milestones: Sprint 46, Sprint 47 Nov 22, 2021
@anthonyfok anthonyfok removed this from the Sprint 47 milestone Jan 17, 2022
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

Successfully merging a pull request may close this issue.

1 participant