Re: Querying a time range across multiple partitions

Поиск
Список
Период
Сортировка
Искать
От
Jeff Janes
Тема
Re: Querying a time range across multiple partitions
Дата
Msg-id
CAMkU=1z3dF_UrwZWaweWiRayaCEJwxehQS=q1pHOGH-JvBgG4w@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Querying a time range across multiple partitions Cal Heldenbrand <cal@fbsdata.com>
Re: Querying a time range across multiple partitions David G Johnston <david.g.johnston@gmail.com>
Re: Querying a time range across multiple partitions Alban Hertroys <haramrae@gmail.com>
Re: Querying a time range across multiple partitions Cal Heldenbrand <cal@fbsdata.com>
Re: Querying a time range across multiple partitions John R Pierce <pierce@hogranch.com>
Re: Querying a time range across multiple partitions Cal Heldenbrand <cal@fbsdata.com>
Re: Querying a time range across multiple partitions Jeff Janes <jeff.janes@gmail.com>
Re: Querying a time range across multiple partitions John R Pierce <pierce@hogranch.com>
Re: Querying a time range across multiple partitions Andreas Brandl <ml@3.141592654.de>
Re: Querying a time range across multiple partitions John R Pierce <pierce@hogranch.com>
Re: Querying a time range across multiple partitions Jeff Janes <jeff.janes@gmail.com>
Re: Querying a time range across multiple partitions Jeff Janes <jeff.janes@gmail.com>
Re: Querying a time range across multiple partitions Cal Heldenbrand <cal@fbsdata.com>

On Fri, Sep 5, 2014 at 2:17 PM, John R Pierce <pierce@hogranch.com> wrote:
On 9/5/2014 10:31 AM, Cal Heldenbrand wrote:
Number of child tables: 1581

that's an insane number of children.    We try and limit it to 50 or so child tables, for instance, 6 months retention by week, of data will millions of rows/day.

I've used more than that many for testing purposes, and there was little problem.  The main thing is that your insert trigger (if you have one on the master table) needs to be structured as a binary search-like nesting of if..elsif, not a linear-searching like structure.  Unless of course almost all inserts go into the newest partition, then it might make more sense to do the linear search with that being the first test.  But for performance, better to just insert directly into the correct child table.

I dont' know if that many tables is a good idea in this case, but it is not prima facie insane.

Cheers,

Jeff
В списке pgsql-general по дате отправления
От: Jeff Janes
Дата:
От: John R Pierce
Дата:
FAQ