Re: Runtime partition pruning - Mailing list pgsql-general

From Michael Lewis
Subject Re: Runtime partition pruning
Date
Msg-id CAHOFxGru-fS3QpTiAfsUXcUzaP3p0G9wtpPJTM_=7X2wsUxDQg@mail.gmail.com
Whole thread Raw
In response to Runtime partition pruning  (Radu Radutiu <rradutiu@gmail.com>)
Responses Re: Runtime partition pruning  (Radu Radutiu <rradutiu@gmail.com>)
List pgsql-general
select * from test where id between client_id-10 and client_id+10  and client_id=?; 

does not (it scans all partitions in parallel) . 
Is it expected?

Yes. But the below would work fine I expect since the planner would know a constant range for id. I would be very surprised if the optimizer had some condition rewrite rules to handle just the scenario you show.

 select * from test where id between ?-10 and ?+10  and client_id=?; 

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Loading 500m json files to database
Next
From: Andres Freund
Date:
Subject: Re: PG12 autovac issues