Re: BUG #16745: delete does not prune partitions on declarative partitioned table

Поиск
Список
Период
Сортировка
От Christian
Тема Re: BUG #16745: delete does not prune partitions on declarative partitioned table
Дата
Msg-id CAFD6L670C1vCP40qo3RAAb3iTmDiB_4bh27HMb0TP+ZQNq+3FQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #16745: delete does not prune partitions on declarative partitioned table  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #16745: delete does not prune partitions on declarative partitioned table  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: BUG #16745: delete does not prune partitions on declarative partitioned table  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-bugs
Ok so this is a known issue.

I test the following command and works fine (it select only one partition) but I'm don't like to much the execute command:

execute 'DELETE FROM FAC_ITEM WHERE FCODDIST='''||DSTCOD||''' AND FSUCURS='||SUCCOD||'::integer AND FFECHAI='''||to_char(FECHAI,'yyyy-mm-dd')||''' AND FIMPNUM<>'||IMPNUM;

Is there any other workaround?







El mié, 25 nov 2020 a las 18:58, Tom Lane (<tgl@sss.pgh.pa.us>) escribió:
PG Bug reporting form <noreply@postgresql.org> writes:
> If I execute:
> select * FROM FAC_ITEM WHERE FCODDIST='' AND FSUCURS=1 AND
> FFECHAI=current_date;
> it use only one partition
> but:
> delete FROM FAC_ITEM WHERE FCODDIST='' AND FSUCURS=1 AND
> FFECHAI=current_date;
> scan all partitions

> Is there any regression?

No.  There's work afoot to improve this, but it wasn't any better before.

                        regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #16745: delete does not prune partitions on declarative partitioned table
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #16745: delete does not prune partitions on declarative partitioned table