Re: Differences between to_tsquery() and plainto_tsquery() when it comes to applying an index? - Mailing list pgsql-general

From Tom Lane
Subject Re: Differences between to_tsquery() and plainto_tsquery() when it comes to applying an index?
Date
Msg-id 29298.1282843643@sss.pgh.pa.us
Whole thread Raw
In response to Re: Differences between to_tsquery() and plainto_tsquery() when it comes to applying an index?  (Denis Papathanasiou <denis.papathanasiou@gmail.com>)
List pgsql-general
Denis Papathanasiou <denis.papathanasiou@gmail.com> writes:
> So is it the case that, as in the documented example, I need to add a
> column of type ts_vector to the table for the index to be most effective?

You can do it either way, depending on what you want the queries to look
like.  One advantage of materializing the tsvector entries in the table
is that the to_tsvector() work doesn't have to be done over again if
the planner decides not to use that index for some reason (for instance,
it thinks the other index is more effective for the particular query).

            regards, tom lane

pgsql-general by date:

Previous
From: Denis Papathanasiou
Date:
Subject: Re: Differences between to_tsquery() and plainto_tsquery() when it comes to applying an index?
Next
From: Matthieu HUIN
Date:
Subject: Re: Weird behavior with custom operators