speedup tidbitmap patch: cache page

Поиск
Список
Период
Сортировка
От Teodor Sigaev
Тема speedup tidbitmap patch: cache page
Дата
Msg-id 54479A85.8060309@sigaev.ru
обсуждение исходный текст
Ответы Re: speedup tidbitmap patch: cache page
Список pgsql-hackers
In specific workload postgres could spend a lot of time in tbm_add_tuples,  up
to 50% of query time. hash_search call is expensive and called twice for each
ItemPointer to insert. Suggested patch tries to cache last PagetableEntry
pointer in hope that next ItemPointer will be on the same relation page.

Patch is rather trivial and I don't believe that it could cause performance
degradation. But it could increase performance on some workload.

An example:
# create extension btree_gin;
# select (v / 10)::int4 as i into t from generate_series(1, 5000000) as v;
# create index idx on t using gin (i);
# set enable_seqscan  = off;

# explain analyze select * from t where i >= 0;
without patch: Execution time: 2427.692 ms
with patch:    Execution time: 2058.718 ms

# explain analyze select * from t where i >= 100 and i<= 100;
without patch: Execution time: 524.441 ms
with patch:    Execution time: 195.381 ms
--
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Marti Raudsepp
Дата:
Сообщение: Re: btree_gin and ranges
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG: *FF WALs under 9.2 (WAS: .ready files appearing on slaves)