Opened 4 years ago

Last modified 4 years ago

#32082 closed New feature

Support "Row Values" in where clause / filter — at Version 1

Reported by: Esteban C Borsani Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Esteban C Borsani)

Using "row values" in the where clause is the only way to make pagination efficient. There is a variation that does not require row values, but it cannot make proper use of composite indices, which usually makes it slower than the more known offset/limit approach (which is already quite slow).

Unless I'm missing something, it seems the only way to implement this is using the QuerySet extra method, and I'd like to avoid that.

Here is a sqlite example of row values, btw:

SELECT * FROM contacts
 WHERE (lastname,firstname) > (?1,?2)
 ORDER BY lastname, firstname
 LIMIT 7;

Change History (1)

comment:1 by Esteban C Borsani, 4 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top