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

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

From
teodor@postgresql.org (Teodor Sigaev)
Date:
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&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&r2=1.3.2.1)

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

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

From
Teodor Sigaev
Date:
> 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/