Re: WIP: index support for regexp search

Alexander Korotkov <aekorotkov@gmail.com>

From: Alexander Korotkov <aekorotkov@gmail.com>
To: Tomas Vondra <tv@fuzzy.cz>, Erik Rijkers <er@xs4all.nl>
Cc: pgsql-hackers@postgresql.org
Date: 2012-11-19T23:08:34Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix filling of postmaster.pid in bootstrap/standalone mode.

  2. Add explicit casts in ilist.h's inline functions.

Attachments

Some quick comments.

On Tue, Nov 20, 2012 at 3:02 AM, Tomas Vondra <tv@fuzzy.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.