Re: WIP: index support for regexp search

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Tomas Vondra <tv(at)fuzzy(dot)cz>, Erik Rijkers <er(at)xs4all(dot)nl>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: WIP: index support for regexp search
Date: 2012-11-19 23:08:34
Message-ID: CAPpHfdvPiGh0b0u=iuvKAOXbuX49EuN-NBLrEF3MFA6xYDh93g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Some quick comments.

On Tue, Nov 20, 2012 at 3:02 AM, Tomas Vondra <tv(at)fuzzy(dot)cz> wrote:

> 6) It does not compile - I do get a bunch of errors like this
>
Fixed.

7) Once fixed, it seems to work
>
> CREATE EXTENSION pg_trgm ;
> CREATE TABLE TEST (val TEXT);
> INSERT INTO test
> SELECT md5(i::text) FROM generate_series(1,1000000) s(i);
> CREATE INDEX trgm_idx ON test USING gin (val gin_trgm_ops);
> ANALYZE test;
>
> EXPLAIN SELECT * FROM test WHERE val ~ '.*qqq.*';
>
>
> QUERY PLAN
> ---------------------------------------------------------------------
> Bitmap Heap Scan on test (cost=16.77..385.16 rows=100 width=33)
> Recheck Cond: (val ~ '.*qqq.*'::text)
> -> Bitmap Index Scan on trgm_idx (cost=0.00..16.75 rows=100
> width=0)
> Index Cond: (val ~ '.*qqq.*'::text)
> (4 rows)
>
> but I do get a bunch of NOTICE messages with debugging info (no matter
> if the GIN index is used or not, so it's somewhere in the common regexp
> code). But I guess that's due to WIP status.
>
It's due to TRGM_REGEXP_DEBUG macro. I disabled it by default. But I think
pieces of code hidden by that macro could be useful for debug even after
WIP status.

------
With best regards,
Alexander Korotkov.

Attachment Content-Type Size
trgm-regexp-0.3.patch.gz application/x-gzip 9.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2012-11-19 23:19:06 Re: MySQL search query is not executing in Postgres DB
Previous Message Tomas Vondra 2012-11-19 23:02:19 Re: WIP: index support for regexp search