Re: R: R: [GENERAL] Slow queries on very big (and partitioned) table - Mailing list pgsql-general

From Tom Lane
Subject Re: R: R: [GENERAL] Slow queries on very big (and partitioned) table
Date
Msg-id 16979.1487718677@sss.pgh.pa.us
Whole thread Raw
In response to Re: R: R: [GENERAL] Slow queries on very big (and partitioned) table  (Stephen Frost <sfrost@snowman.net>)
List pgsql-general
Stephen Frost <sfrost@snowman.net> writes:
> * Job (Job@colliniconsulting.it) wrote:
>> We thought to implement one partition for day.
>> Do you think it should be fine?

> Really depends on what you're doing.  If you're running very short
> queries that pull out just a record or a few records, then you're going
> to be unhappy with the planning time required when you have hundreds and
> thousands of partitions, which is why I typically recommend against
> using partitions-by-day unless you're only keeping a few months worth of
> data.

Or to put it more simply: if you have more than O(100) partitions,
you're doing it wrong.  There is a cost to subdividing things too finely.

The improved partitioning support that's going into v10 will probably
allow more partitions before it really starts to groan, but it'll still
not be a great idea to create more than the minimum number of partitions
you really need.

            regards, tom lane


pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [GENERAL] NOTIFY command impact
Next
From: Patrick B
Date:
Subject: Re: [GENERAL] bloat indexes - opinion