#28670 closed Cleanup/optimization (fixed)
Add native LIMIT/OFFSET support on Oracle.
| Reported by: | Markus Stenberg | Owned by: | Mariusz Felisiak |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Currently the code which does the LIMIT+OFFSET clause emulation there with ROWNUM (which assorted sources on the internet recommend not to do) is no longer needed. Oracle 12 supports SQL syntax for this:
https://oracle-base.com/articles/12c/row-limiting-clause-for-top-n-queries-12cr1
[ OFFSET offset { ROW | ROWS } ]
[ FETCH { FIRST | NEXT } [ { rowcount | percent PERCENT } ]
{ ROW | ROWS } { ONLY | WITH TIES } ]
This applies to all versions, but is probably reasonable to implement in 2.0+ onlyas then there is no need to worry about Oracle 11 which does not support the syntax.
Change History (7)
comment:1 by , 8 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|---|
| Version: | 2.0 → master |
comment:2 by , 8 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
| Summary: | django/db/backends/oracle/compiler.py handling of LIMIT+OFFSET could be better in Oracle 12+. → Add native LIMIT/OFFSET support on Oracle. |
comment:3 by , 8 years ago
comment:5 by , 8 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Note:
See TracTickets
for help on using tickets.
In 03da070: