Re: Differences between to_tsquery() and plainto_tsquery() when it comes to applying an index?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Denis Papathanasiou <denis(dot)papathanasiou(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Subject: Re: Differences between to_tsquery() and plainto_tsquery() when it comes to applying an index?
Date: 2010-08-26 17:27:23
Message-ID: 29298.1282843643@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Denis Papathanasiou <denis(dot)papathanasiou(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian von Bidder 2010-08-26 19:30:12 Re: Feature proposal
Previous Message Denis Papathanasiou 2010-08-26 17:21:53 Re: Differences between to_tsquery() and plainto_tsquery() when it comes to applying an index?