Re: BUG #16855: No partition pruning when using partitions with custom hash function

From: Michał Albrycht <michalalbrycht(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Staszek Skonieczny <stanislaw(dot)skonieczny(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16855: No partition pruning when using partitions with custom hash function
Date: 2021-03-02 14:12:00
Message-ID: CACsoHGCRW=O74CBipE12tYX=Sdxz5bhtp2OBZej6DLkKBmqr2g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I'm trying to make it work I can't. How can I include next = operator in
the opclass? I would like to make partition pruning work for both int4 and
int8. Could someone help me understand what needs to be added here?
Thank you in advance for any suggestions.

Michał Albrycht

wt., 2 mar 2021 o 14:59 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napisał(a):

> PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> > I'd expect that only one partition will be scanned, other 2 will be
> removed
> > by partition pruning.
>
> It works if you write
>
> regression=# explain select * from sample where part_id = 1::bigint;
> QUERY PLAN
> ----------------------------------------------------------------------
> Seq Scan on sample_part_1 sample (cost=0.00..38.25 rows=11 width=8)
> Filter: (part_id = '1'::bigint)
> (2 rows)
>
> As it stands, the query uses the "bigint = integer" operator,
> which you have not included in your custom opclass.
>
> regards, tom lane
>
>
>
>
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Hamid Akhtar 2021-03-02 14:16:35 Re: BUG #16909: On update (not insert) the attisdropped flag is set for tables which are recreated with the same col
Previous Message David Steele 2021-03-02 12:46:21 Re: BUG #16894: PANIC: WAL contains references to invalid pages