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

First queries are unbounded #64

Closed
jorgecarleitao opened this issue Jan 13, 2022 · 1 comment
Closed

First queries are unbounded #64

jorgecarleitao opened this issue Jan 13, 2022 · 1 comment

Comments

@jorgecarleitao
Copy link

Hi,

Thank you for creating this library.

I am a bit puzzled by the queries that this library is producing. Given a query(Model).order_by(*pks), this library is generating 3 queries when get_page(query, 20) is used:

  • a SELECT * FROM ... ORDER BY pk
  • a SELECT * FROM ... ORDER BY pk
  • a SELECT * FROM ... ORDER BY pk ASC LIMIT 21

(observed by the statements outputted by the sqlalchemy.engine logger to INFO)

Do we need to perform the first two (equal) unbounded statements against the table to retrieve the bookmarks? These statements are quite expensive in a large table

@jorgecarleitao
Copy link
Author

Nvmd, this has been fixed in a subsequent release. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant