Re: concurrent re-partitioning of declarative partitioned tables - Mailing list pgsql-general

From Nick Cleaton
Subject Re: concurrent re-partitioning of declarative partitioned tables
Date
Msg-id CAFgz3ku6v+Tq232VkaBHO8D_7hvP+f23WDLBibU1es_EfAaq+w@mail.gmail.com
Whole thread Raw
In response to Re: concurrent re-partitioning of declarative partitioned tables  (Michael Lewis <mlewis@entrata.com>)
List pgsql-general
On Wed, 2 Dec 2020 at 15:59, Michael Lewis <mlewis@entrata.com> wrote:
You can not have overlapping partitions that are both attached.

Not directly, no. That's why I'm considering the _partition_channel hack.

Why do you want to merge partitions that you are "done with" instead of just leaving them partitioned by day?

I have some random access index lookups on columns not in the partition key, where values are unique over the entire table so at most one partition is going to return a row. A lookup that touches 4 or 5 pages in each of 100 partition indexes is more expensive than one that touches 6 or 7 pages in each of 10 larger partition indexes.

Why are you partitioning at all? Are you confident that you need partitions for performance & that the trade-offs are worth the cost, or are you needing to detach/drop old data quickly to adhere to a retention policy?

I do want cheap drops of old data, but also many queries have indexable conditions on non-key columns and also only want records from the most recent N days, so partition pruning is useful there with small partitions for recent records.

pgsql-general by date:

Previous
From: Nick Cleaton
Date:
Subject: Re: concurrent re-partitioning of declarative partitioned tables
Next
From: guyren@icloud.com
Date:
Subject: Is the Halloween problem an issue in Postgres