Re: Optimize date query for large child tables: GiST or GIN?

Поиск
Список
Период
Сортировка
Искать
От
Matthew Wakeling
Тема
Re: Optimize date query for large child tables: GiST or GIN?
Дата
в 12:08:49
Msg-id
alpine.DEB.2.00.1005211100240.11385@aragorn.flymine.org
Ответ на
Список
Дерево обсуждения
Optimize date query for large child tables: GiST or GIN? David Jarvis <thangalin@gmail.com>
Re: Optimize date query for large child tables: GiST or GIN? Stephen Frost <sfrost@snowman.net>
Re: Optimize date query for large child tables: GiST or GIN? David Jarvis <thangalin@gmail.com>
Re: Optimize date query for large child tables: GiST or GIN? Yeb Havinga <yebhavinga@gmail.com>
Re: Optimize date query for large child tables: GiST or GIN? Thom Brown <thombrown@gmail.com>
Re: Optimize date query for large child tables: GiST or GIN? Matthew Wakeling <matthew@flymine.org>
Re: Optimize date query for large child tables: GiST or GIN? Tom Lane <tgl@sss.pgh.pa.us>
Re: Optimize date query for large child tables: GiST or GIN? David Jarvis <thangalin@gmail.com>
On Fri, 21 May 2010, Yeb Havinga wrote:
> For time based data I would for sure go for year based indexing.

On the contrary, most of the queries seem to be over many years, but 
rather restricting on the time of year. Therefore, partitioning by month 
or some other per-year method would seem sensible.

Regarding the leap year problem, you might consider creating a modified 
day of year field, which always assumes that the year contains a leap day. 
Then a given number always resolves to a given date, regardless of year. 
If you then partition (or index) on that field, then you may get a 
benefit.

In this case, partitioning is only really useful when you are going to be 
forced to do seq scans. If you can get a suitably selective index, in the 
case where you are selecting a small proportion of the data, then I would 
concentrate on getting the index right, rather than the partition, and 
maybe even not do partitioning.

Matthew

-- 
 Trying to write a program that can't be written is... well, it can be an
 enormous amount of fun!                 -- Computer Science Lecturer
В списке pgsql-performance по дате отправления
От: Piotr Legiecki
Дата:
От: David Jarvis
Дата:
FAQ