Re: Index Usage and Running Times by FullTextSearch with prefix matching

From: rawi <only4com(at)web(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Index Usage and Running Times by FullTextSearch with prefix matching
Date: 2013-06-13 15:39:26
Message-ID: 1371137966540-5759046.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tom Lane-2 wrote
> FWIW, I get fairly decent performance for cases like this in HEAD
> (at least with a GIN index; GIST seems much less able to do well with
> short prefixes).

Short or long prefixes seem to be equaly unfavorable. Even with the full
length of the words, but queried as prefix I get a runtime of 25342ms
compared to 353ms without prefixes:

SELECT count(a)
FROM t1
WHERE a_tsvector @@ to_tsquery('aaaaa:* & bbbbb:* & ccccc:* & ddddd:*')

Total query runtime: 25342 ms

"Aggregate (cost=804.02..804.03 rows=1 width=36)"
" -> Bitmap Heap Scan on t1 (cost=800.00..804.02 rows=1 width=36)"
" Recheck Cond: (a_tsvector @@ to_tsquery('aaaaa:* & bbbbb:* &
ccccc:* & ddddd:*'::text))"
" -> Bitmap Index Scan on a_tsvector_idx (cost=0.00..800.00 rows=1
width=0)"
" Index Cond: (a_tsvector @@ to_tsquery('aaaaa:* & bbbbb:* &
ccccc:* & ddddd:*'::text))"

Kind Regards
Rawi

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Index-Usage-and-Running-Times-by-FullTextSearch-with-prefix-matching-tp5759021p5759046.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message JORGE MALDONADO 2013-06-13 22:40:36 Select clause in JOIN statement
Previous Message rawi 2013-06-13 15:20:56 Re: Index Usage and Running Times by FullTextSearch with prefix matching