Re: Proposal: partition pruning by secondary attributes - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Proposal: partition pruning by secondary attributes
Date
Msg-id 20180208180138.5cjrgfgythjiurca@alap3.anarazel.de
Whole thread Raw
In response to Re: Proposal: partition pruning by secondary attributes  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Proposal: partition pruning by secondary attributes  (Ildar Musin <i.musin@postgrespro.ru>)
List pgsql-hackers
On 2018-02-08 14:48:34 -0300, Alvaro Herrera wrote:
> Ildar Musin wrote:
> 
> > The idea is to store min and max values of secondary attributes (like
> > 'id' in the example above) for each partition somewhere in catalog and
> > use it for partition pruning along with partitioning key. You can think
> > of it as somewhat like BRIN index but for partitions.
> 
> What is the problem with having a BRIN index?

Building plans to scan the individual partitions, lock them, open the
relevant files, etc is often going to be significantly more expensive
than pruning at plan time.

But there also seems to be a number of fairly nasty locking issues with
this proposal, leaving the amount of required code aside.

Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] path toward faster partition pruning
Next
From: Rafal Pietrak
Date:
Subject: Re: it's a feature, but it feels like a bug