The main problem is probably that you are not using the Load Command, which is important with DPF to get maximum performance (parallel bulk loads). If you could do a load from cursor in the stored procedure, I would try that, otherwise probably try to format a flat file to be loaded using the Load command.
I notice that you are using the following types of partitioning:
- DPF (DISTRIBUTE BY HASH)
- Table Partitioning (PARTITION BY RANGE)
- MDC (ORGANIZE BY)
I can't see your other Keys and Indexes, but if you want partitioned indexes, the Table Partitioning column must be included in all unique indexes (PK's, etc).
Do you really need the MDC? My gut feel is that you have
way too much data for each date to make that part of a MDC, and since you are already doing Table Partitioning by Date, what exactly is the point of the MDC?.
Instead, I would create a PK of (Start_date, subscriber_arrangement_id) in that order (you need start_date in the PK to have partitioned indexes). Then create another index on Event_id (if it has sufficient cardinality), and a third (non-unique) index on subscriber_arrangement_id (cannot be unique if you want partitioned indexes). Forget about MDC for this table.