diff options
author | Jenkins <jenkins@review.openstack.org> | 2017-02-07 08:13:11 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-02-07 08:13:11 +0000 |
commit | 02247b3a0ec75d96acfff740b935e07cbac32a1b (patch) | |
tree | 1065d026771e83b79895dae96c923422e96e97de | |
parent | 50faace2106f08f0b50dfadd196281c15b8b8f7f (diff) | |
parent | 9fb3c018fc16c8f5b781c119dd3c148ed7954db7 (diff) | |
download | oslo-db-02247b3a0ec75d96acfff740b935e07cbac32a1b.tar.gz |
Merge "Explain paginate_query doesn't provide parameter offset"
-rw-r--r-- | oslo_db/sqlalchemy/utils.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/oslo_db/sqlalchemy/utils.py b/oslo_db/sqlalchemy/utils.py index 97a28c6..f3db1dc 100644 --- a/oslo_db/sqlalchemy/utils.py +++ b/oslo_db/sqlalchemy/utils.py @@ -155,6 +155,11 @@ def paginate_query(query, model, limit, sort_keys, marker=None, marker, then the actual marker object must be fetched from the db and passed in to us as marker. + The "offset" parameter is intentionally avoided. As offset requires a + full scan through the preceding results each time, criteria-based + pagination is preferred. See http://use-the-index-luke.com/no-offset + for further background. + :param query: the query object to which we should add paging/sorting :param model: the ORM model class :param limit: maximum number of items to return |