#9136: Oracle backend: slicing is using row_number() instead of rownum
-------------------------------------------------------------------------------+
Reporter: Guillaume Taglang <[EMAIL PROTECTED]> | Owner:
nobody
Status: new
| Milestone:
Component: Database layer (models, ORM)
| Version: 1.0
Resolution:
| Keywords:
Stage: Unreviewed
| Has_patch: 1
Needs_docs: 0
| Needs_tests: 0
Needs_better_patch: 0
|
-------------------------------------------------------------------------------+
Comment (by gtaglang):
The change to the query in [9221] fixes my main gripes about slicing with
oracle.
My own test on a set of table with some real data do not show any
significant difference between rownum and row_number() for the first few
rows, however as the number of rows increase row_number() gets
significantly slower.
If you look at the result of an explain plan you will easily understand
why: row_number() is an analytic function and the database needs to apply
the function first; rownum on the oder hand is built in the query and
costs nothing. Depending on data and indexes the cost difference between
rownum and row_number(), as calculated by the optimizer, can reach several
order of magnitude. (At least for my release of Oracle: 10.2 Enterprise.)
(As a side note: 870ms per query for the table you mentioned is really
bad. Are you sure you did execute the tests with warm and/or cold cache
for both rownum and row_number() ?)
(Second side note: looks like the spam filter is a tad overzealous.)
--
Ticket URL: <http://code.djangoproject.com/ticket/9136#comment:4>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---