Re: GIN improvements part2: fast scan
От | Alexander Korotkov |
---|---|
Тема | Re: GIN improvements part2: fast scan |
Дата | |
Msg-id | CAPpHfdsqDCa94Gy9QHHgbA3PmTNr9NCnY_WFYks0MNXjwFq1OQ@mail.gmail.com обсуждение исходный текст |
Ответ на | GIN improvements part2: fast scan (Alexander Korotkov <aekorotkov@gmail.com>) |
Ответы |
Re: GIN improvements part2: fast scan
|
Список | pgsql-hackers |
On Sat, Jun 15, 2013 at 2:55 AM, Alexander Korotkov <aekorotkov@gmail.com> wrote:
------
With best regards,
attached patch implementing "fast scan" technique for GIN. This is second patch of GIN improvements, see the 1st one here:This patch allow to skip parts of posting trees when their scan is not necessary. In particular, it solves "frequent_term & rare_term" problem of FTS.It introduces new interface method pre_consistent which behaves like consistent, but:1) allows false positives on input (check[])2) allowed to return false positivesSome example: "frequent_term & rare_term" becomes pretty fast.create table test as (select to_tsvector('english', 'bbb') as v from generate_series(1,1000000));insert into test (select to_tsvector('english', 'ddd') from generate_series(1,10));create index test_idx on test using gin (v);postgres=# explain analyze select * from test where v @@ to_tsquery('english', 'bbb & ddd');QUERY PLAN-----------------------------------------------------------------------------------------------------------------------Bitmap Heap Scan on test (cost=942.75..7280.63 rows=5000 width=17) (actual time=0.458..0.461 rows=10 loops=1)Recheck Cond: (v @@ '''bbb'' & ''ddd'''::tsquery)-> Bitmap Index Scan on test_idx (cost=0.00..941.50 rows=5000 width=0) (actual time=0.449..0.449 rows=10 loops=1)Index Cond: (v @@ '''bbb'' & ''ddd'''::tsquery)Total runtime: 0.516 ms(5 rows)
Attached version of patch has some refactoring and bug fixes.
With best regards,
Alexander Korotkov.
Вложения
В списке pgsql-hackers по дате отправления: