#22666: (Generic)IPAddressField index never used on PostgreSQL, inconsistent
behavior
-------------------------------------+-------------------------------------
Reporter: intgr | Owner: nobody
Type: Uncategorized | Status: new
Component: Database layer | Version: 1.6
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by erikr):
* needs_better_patch: => 0
* needs_docs: => 0
* component: Uncategorized => Database layer (models, ORM)
* needs_tests: => 0
* stage: Unreviewed => Accepted
Comment:
I can definitely see the issue here. A few minor points:
* IPAddressField is deprecated and will be removed in 1.9. I don't think
we should fix anything in it: anyone experiencing an issue can migrate to
GenericIPAddressField. That doesn't solve this ticket though, as you
correctly describe, GenericIPAddressField has the same issue.
* Another ticket of interest may be #11442 - which in its final resolution
allows defining custom fields using INET that are not forced through
`HOST()`
If we implement `__contains` to work the same as for integers, the only
difference between databases would be that sorting is different, right?
But filtering would still work the same? In the case of IP addresses, it
seems to me that string sorting is a bit silly in any case. Balancing that
against the inability to index even exact match queries, makes this
solution seem very reasonable to me.
--
Ticket URL: <https://code.djangoproject.com/ticket/22666#comment:1>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/063.5c895e123d78cac895da78ed5d495ffa%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.