Re: how to "explain" some ddl

2020-07-20 Thread Michel Pelletier
Marc, If you add a check constraint that proves the new child partition has no out of bounds rows, then the ATTACH PARTITION will not block: "Before running the ATTACH PARTITION command, it is recommended to create a CHECK constraint on the table to be attached matching the desired partition cons

Re: how to "explain" some ddl

2020-07-14 Thread Marc Millas
Hi Tom, a few tests later. Looks like when you add a partition as default, all tupples of it are read, even if there is an index on the column that is the partition key. this do explain our attach time. We are going to clean the default partition... regards, Marc MILLAS Senior Architect +33607850

Re: how to "explain" some ddl

2020-07-14 Thread Marc Millas
Hi, thanks for the answer. the pb is that the fact table do have mods for "old" data. so the current scheme implies to truncate partitions and recreate them, and copy from ods to dm, etc which is better than millions (tens of) delete and vacuuming. and so, the partitioning scheme is based on day s

Re: how to "explain" some ddl

2020-07-14 Thread Tom Lane
Marc Millas writes: > We would like to understand where an alter table attach partition spend its > time. > to my understanding, explain doesnt do this. Nope :-(. As our DDL commands have gotten more complicated, there's been some discussion of adding that, but nothing's really been done yet. T

how to "explain" some ddl

2020-07-14 Thread Marc Millas
Hi, We would like to understand where an alter table attach partition spend its time. to my understanding, explain doesnt do this. for a BI job we have a partitionned table with 1800+ partitions. the feeding process of this table leeds to detach and attach partitions. attaching do take time, somet