Re: Partial indexes instead of partitions

Поиск
Список
Период
Сортировка
От Leonardo F
Тема Re: Partial indexes instead of partitions
Дата
Msg-id 709423.97075.qm@web29004.mail.ird.yahoo.com
обсуждение исходный текст
Ответ на Re: Partial indexes instead of partitions  (Sergey Konoplev <gray.ru@gmail.com>)
Ответы Re: Partial indexes instead of partitions  (Sergey Konoplev <gray.ru@gmail.com>)
Re: Partial indexes instead of partitions  (David Wilson <david.t.wilson@gmail.com>)
Список pgsql-general
> For "inserts" I do not see the reason
> why
> it would be better to use index partitioning because AFAIK
> b-tree
> would behave exactly the same in both cases.

no, when the index gets very big inserting random values gets
very slow.

But still, my approach doesn't work because I thought Postgresql
was able to "merge" different partial indexes (using
BitmapOr/BitmapAnd) when the WHERE condition matches multiple
partial indexes... but that's (I guess) not that easy to do

(basically partial indexes condition should be checked like the
constraint of the inheritance mechanism, and Or/And Bitmapped
as happens in the "regular" partitioning method).

that is, having a table with:


CREATE TABLE test
(
    a timestamp without time zone,
    b integer
)


CREATE INDEX test1idx
  ON test
  (b)
  WHERE a >= '2008-03-10 14:00:00' AND a < '2008-03-10 16:00:00';

CREATE INDEX test2idx
  ON test
  (b)
  WHERE a >= '2008-03-10 16:00:00' AND a < '2008-03-10 18:00:00';


the select:

select * from test where a > '2008-03-10 15:00:00'
   and a < '2008-03-10 17:00:00'  and b = 100

should use a BitmapOr between an index scan on test1idx and test2idx...

But I think that's a complicated thing for the planner... even though
it doesn't sound that different from what the planner does for partition
pruning...




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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Re: Error on Windows server could not open relation base/xxx/xxx Permission denied
Следующее
От: Janning
Дата:
Сообщение: Re: checkpoint spikes