is this the correct result for ts_rewrite? reducing tsquery to improve performance?

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: is this the correct result for ts_rewrite? reducing tsquery to improve performance?
Date: 2010-01-29 01:14:04
Message-ID: 20100129021404.279bbfe2@dawn.webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

select ts_rewrite(
to_tsquery('java:A & cola & java:AB'),
'java:AB'::tsquery,
'java:AB'::tsquery);

ts_rewrite
--------------------------------
'cola' & 'java':AB & 'java':AB

Is this the expected (documented) result?

I found this while looking for a way to build up a tsquery directly
in it's own structure without passing through its text
representation (and maybe reduce it).

The following looks equivalent. Are they?

test=# select 'java:ABC'::tsquery;
tsquery
------------
'java':ABC
(1 row)

test=# select 'java:A | java:B | java:C'::tsquery;
tsquery
------------------------------------
( 'java':A | 'java':B ) | 'java':C
(1 row)

I did try to pass them through nodetree... but the result keeps on
being different.

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

Browse pgsql-general by date

  From Date Subject
Next Message Nick 2010-01-29 03:34:31 Re: Problem with query using ST_Dwithin
Previous Message Craig Ringer 2010-01-29 01:08:16 Re: how to update a view from a table