partition pruning only works for select but update

Поиск
Список
Период
Сортировка
От James Pang (chaolpan)
Тема partition pruning only works for select but update
Дата
Msg-id PH0PR11MB519134D4171A126776E3E063D6B89@PH0PR11MB5191.namprd11.prod.outlook.com
обсуждение исходный текст
Ответы Re: partition pruning only works for select but update  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance

Hi,

  We have a table have range partition (about 5K partitions) , when

Explain select count(*) from table where  partitionkey between  to_timestamp() and to_timestamp();

It show

Aggregate  (cost=15594.72..15594.73 rows=1 width=8)

   ->  Append  (cost=0.15..15582.00 rows=5088 width=0)

         Subplans Removed: 5086

 

But when

Explain update table set .. where  partitionkey between  to_timestamp() and to_timestamp();

  It still show all of partitions with update …

 

enable_partition_pruning keep defaut value ‘on’, It’s expected ?  and we found for update sql with same where condition, it consumes huge memory than select.

Database version is Postgres 13.4 on RHEL8.4.

 

 

Thanks,

 

James

   

В списке pgsql-performance по дате отправления:

Предыдущее
От: "I. V."
Дата:
Сообщение: Re: reindex option for tuning load large data
Следующее
От: Tom Lane
Дата:
Сообщение: Re: partition pruning only works for select but update