Re: Forcing more agressive index scans for BITMAP AND

Поиск
Список
Период
Сортировка
От Matthew
Тема Re: Forcing more agressive index scans for BITMAP AND
Дата
Msg-id Pine.LNX.4.64.0804041137500.20402@aragorn.flymine.org
обсуждение исходный текст
Ответ на Forcing more agressive index scans for BITMAP AND  (Ow Mun Heng <Ow.Mun.Heng@wdc.com>)
Ответы Re: Forcing more agressive index scans for BITMAP AND  (PFC <lists@peufeu.com>)
Список pgsql-performance
On Fri, 4 Apr 2008, Ow Mun Heng wrote:
> select * from table
> where A=X
> and B = Y
> and C = Z
> and D = AA
> and E = BB

This may not be the answer you're looking for, but if you create a
multi-coloumn index, it should be able to make your query run fast:

CREATE INDEX foo ON table (A, B, C, D, E);

It'll certainly be faster than building a bitmap for the contents of five
separate indexes.

Matthew

--
-. .-.   .-. .-.   .-. .-.   .-. .-.   .-. .-.   .-. .-.   .-.
||X|||\ /|||X|||\ /|||X|||\ /|||X|||\ /|||X|||\ /|||X|||\ /|||
|/ \|||X|||/ \|||X|||/ \|||X|||/ \|||X|||/ \|||X|||/ \|||X|||/
'   `-' `-'   `-' `-'   `-' `-'   `-' `-'   `-' `-'   `-' `-'

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

Предыдущее
От: Ow Mun Heng
Дата:
Сообщение: Forcing more agressive index scans for BITMAP AND
Следующее
От: PFC
Дата:
Сообщение: Re: Forcing more agressive index scans for BITMAP AND