#9596: Comparing a DateTimeField to a date is too hard
---------------------------------------------------+------------------------
Reporter: [email protected] | Owner: nobody
Status: new | Milestone:
Component: Database layer (models, ORM) | Version: SVN
Resolution: | Keywords:
lookup_type date datetimefield compare comparison query_term field lookup
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Comment (by ssadler):
Replying to [comment:14 Alex]:
> Any particular reason this patch is implemented as an __range as opposed
to doing __year, __month, and __day (genuinely curious).
It didn't occur to me at the time, but I don't think it would be better.
I'm not sure how the year, month and day lookups are implemented in
Django, but if they aren't also done as ranges then the SQL engine has to
convert column for each row, which means that it can't use any indexes
that may exist on that column. If they are done as ranges it would produce
three range lookups instead of one.
--
Ticket URL: <http://code.djangoproject.com/ticket/9596#comment:17>
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
-~----------~----~----~----~------~----~------~--~---