We have a job that loads some tables every night from our source db to target db, many of them are partitioned by range or list. Before loading a table we truncate it first and for some reason, this process is taking too long time for particular tables.
For instance,TABLE A
has 62 mln rows and has been partitioned by list (column BRANCH_CODE
). Number of partitions is 213. Truncating this table took 20 seconds .
TABLE B
has 17 mln rows, has been range partitioned by DAY
column, interval is month, every partitiion has 213 subpartitions by list (column BRANCH_CODE
). So in this case, number of partitions is 60 and number of subpartitions is 12 780. Truncating this table took 15 minutes.
Is the reason of long truncate process too many partitions? Or maybe we have missed some table specs or should we set specifig storage parameters for a table?