pgsql: Fix memory arrangement of tsquery after removing stop words.

Started by Teodor Sigaevover 18 years ago3 messagescomitters
Jump to latest
#1Teodor Sigaev
teodor@sigaev.ru

Log Message:
-----------
Fix memory arrangement of tsquery after removing stop words. It causes
a unused memory holes in tsquery.

Per report by Richard Huxton <dev@archonet.com>.

It was working well because in fact tsquery->size is not used for any
kind of operation except comparing tsqueries. To prevent requirement
of renew all stored tsquery optimization in CompareTSQ is removed.

Tags:
----
REL8_3_STABLE

Modified Files:
--------------
pgsql/src/backend/tsearch:
to_tsany.c (r1.8 -> r1.8.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/tsearch/to_tsany.c?r1=1.8&amp;r2=1.8.2.1)
pgsql/src/backend/utils/adt:
tsquery_op.c (r1.3 -> r1.3.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/tsquery_op.c?r1=1.3&amp;r2=1.3.2.1)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Teodor Sigaev (#1)
Re: pgsql: Fix memory arrangement of tsquery after removing stop words.

teodor@postgresql.org (Teodor Sigaev) writes:

Fix memory arrangement of tsquery after removing stop words. It causes
a unused memory holes in tsquery.

The buildfarm indicates there's something wrong with the 8.3 version
of this patch ...

regards, tom lane

#3Teodor Sigaev
teodor@sigaev.ru
In reply to: Tom Lane (#2)
Re: pgsql: Fix memory arrangement of tsquery after removing stop words.

The buildfarm indicates there's something wrong with the 8.3 version
of this patch ...

Oh, my mistake. That means that patch of CompareTSQ should be reverted, because
it change comparing of existing tsquery (it's important for existing btree indexes).

Computing tsquery->size and length of tsquery instead of using stored values
causes the same effect: it will affect existing btree indexes.

However, Btree index over tsquery is not very useful. IMHO, the single purpose
is a guarantee unique of stored tsquery.

--
Teodor Sigaev E-mail: teodor@sigaev.ru
WWW: http://www.sigaev.ru/