Re: Runtime partition pruning

Поиск
Список
Период
Сортировка
От Michael Lewis
Тема Re: Runtime partition pruning
Дата
Msg-id CAHOFxGru-fS3QpTiAfsUXcUzaP3p0G9wtpPJTM_=7X2wsUxDQg@mail.gmail.com
обсуждение исходный текст
Ответ на Runtime partition pruning  (Radu Radutiu <rradutiu@gmail.com>)
Ответы Re: Runtime partition pruning
Список 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 по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Loading 500m json files to database
Следующее
От: Andres Freund
Дата:
Сообщение: Re: PG12 autovac issues