Re: [HACKERS] path toward faster partition pruning - Mailing list pgsql-hackers

From David Rowley
Subject Re: [HACKERS] path toward faster partition pruning
Date
Msg-id CAKJS1f_gTUyVw0AZMKyg7CQtGJwJatuMpD_j1QTgn0qqtwdSFQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] path toward faster partition pruning  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: [Sender Address Forgery]Re: [HACKERS] path toward fasterpartition pruning  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
On 31 October 2017 at 21:43, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote:
> Attached updated version of the patches

match_clauses_to_partkey() needs to allow for the way quals on Bool
columns are represented.

create table pt (a bool not null) partition by list (a);
create table pt_true partition of pt for values in('t');
create table pt_false partition of pt for values in('f');
explain select * from pt where a = true;                           QUERY PLAN
------------------------------------------------------------------Append  (cost=0.00..76.20 rows=2810 width=1)  ->  Seq
Scanon pt_false  (cost=0.00..38.10 rows=1405 width=1)        Filter: a  ->  Seq Scan on pt_true  (cost=0.00..38.10
rows=1405width=1)        Filter: a
 
(5 rows)

match_clause_to_indexcol() shows an example of how to handle this.

explain select * from pt where a = false;

will need to be allowed too. This works slightly differently.

-- David Rowley                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Connor Wolf
Date:
Subject: Re: [HACKERS] How to implement a SP-GiST index as a extension module?
Next
From: Amit Kapila
Date:
Subject: Re: [HACKERS] Setting pd_lower in GIN metapage