Re: Timestamp indicies not being used!

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: Timestamp indicies not being used!
Дата
Msg-id 20090719125604.GA7124@tux
обсуждение исходный текст
Ответ на Re: Timestamp indicies not being used!  (Sam Mason <sam@samason.me.uk>)
Ответы Re: Timestamp indicies not being used!
Re: Timestamp indicies not being used!
Список pgsql-general
Sam Mason <sam@samason.me.uk> wrote:

> On Sun, Jul 19, 2009 at 11:15:39AM +0100, Pedro Doria Meunier wrote:
> > I have a table ~18M rows with a 'timestamp with time zone' column. It's
> > indexed thus:
> >
> > CREATE INDEX my_table_timestamp_idx
> >   ON my_table
> >   USING btree
> >   (zulu_timestamp);
>
> Based on your query, I think you want a multi-column index---probably on
> (id,zulu_timestamp).
>
> The problem with just having an index on either column is that it's
> difficult to combine them and PG hence just thinks that it will be

Since 8.1 PG can do an bitmap index scan using both indexes...

Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

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

Предыдущее
От: Sam Mason
Дата:
Сообщение: Re: Timestamp indicies not being used!
Следующее
От: Sim Zacks
Дата:
Сообщение: Re: table/view/function access counts