#31304: PostgreSQL full-text search employs coalesce function for non-null
single-
column searches with SearchVector
-------------------------------------+-------------------------------------
Reporter: Paul Boddie | Owner: nobody
Type: Uncategorized | Status: new
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: PostgreSQL text | Triage Stage:
search FTS coalesce SearchVector | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Paul Boddie):
The motivation for eliminating coalesce is that it is superfluous when
searching a non-null column already indexed appropriately. I accept that
in the general case, where people may be combining columns, there may be a
need to coalesce null values, but I would regard it as pretty inelegant to
have to create an index coalescing values that would never be null. (One
might argue that PostgreSQL could itself eliminate any redundant coalesce
operation specified for an index, and I don't know why it doesn't in this
case.)
The suggestion to make the search lookup employ any indicating
configuration from the operand is a good one. Indeed, it surprises me that
this isn't already done because it appears to be an easy mistake when
manually preparing queries that could be eliminated in a framework like
this.
I'll try and make a pull request on GitHub.
--
Ticket URL: <https://code.djangoproject.com/ticket/31304#comment:4>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.ef2827fba76c00c43abe2a5f018913fb%40djangoproject.com.