summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-02-07 08:13:11 +0000
committerGerrit Code Review <review@openstack.org>2017-02-07 08:13:11 +0000
commit02247b3a0ec75d96acfff740b935e07cbac32a1b (patch)
tree1065d026771e83b79895dae96c923422e96e97de
parent50faace2106f08f0b50dfadd196281c15b8b8f7f (diff)
parent9fb3c018fc16c8f5b781c119dd3c148ed7954db7 (diff)
downloadoslo-db-02247b3a0ec75d96acfff740b935e07cbac32a1b.tar.gz
Merge "Explain paginate_query doesn't provide parameter offset"
-rw-r--r--oslo_db/sqlalchemy/utils.py5
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