#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 ikelly):
I tried to do some limited benchmarking on this on an Oracle XE
installation and got conflicting results. The model I used was this:
{{{
class Test(models.Model):
class Meta:
ordering = ['id']
}}}
With 1,000,000 rows in the table, I tried taking slices of 100 rows from
the beginning, middle, and end of the table. Using rownum, the time was
consistently about 870 ms/query. Using row_number(), the time was about
20 ms/query from the beginning of the table, about the same as rownum from
the middle, and about twice as long as rownum from the end. Removing the
default ordering from the model slightly sped up rownum, but slightly
slowed down row_number().
It's difficult to judge, but I guess that the most common scenario for
slicing large table would be taking small slices from near the beginning
of an ordered query. From that point of view, I'm in favor of keeping
row_number() at this point, but I could be persuaded to change my mind
with fresh evidence.
Note that I recently changed the overall structure of the query in [9221],
which could have an impact on the results.
--
Ticket URL: <http://code.djangoproject.com/ticket/9136#comment:3>
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
-~----------~----~----~----~------~----~------~--~---