Be careful with LOAD FROM CURSOR, the cursor is a bottle neck. To do
that in a scalable fashion you would fire up concurrent LOADs on each
node filtering the source by DBPARTITION.
You shouldn't need UNION ALL.
Cheers
Serge

Signature
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Serge,
again thanks for your quick reply :-)
I will try to get snapshot information next days (Problem is that "get
snapshot for all " runs 1 hour on production and once crashed the instance
in the past :-) (problem is fixed in FP7 which will be applied in the near
time)).
> Have you verified that the plans are good? You shouldn't see any TQs.
> Also are you sure you don't have any other complicating factors (SQL
> Functions, Triggers, check or RI constraints) (The plans will show).
The plan looks good (for me). Maybe you can comment it:
Section Code Page = 819
Estimated Cost = 31926.718750
Estimated Cardinality = 75608.000000
Coordinator Subsection - Main Processing:
(-----) Distribute Subsection #1
| Broadcast to Node List
| | Nodes = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
| | 11, 12
Subsection #1:
( 3) Access Table Name = DTMP1T.STAGING ID = 411,121
| #Columns = 24
| Volatile Cardinality
| Relation Scan
| | Prefetch: Eligible
| Lock Intents
| | Table: Intent Share
| | Row : Next Key Share
( 2) Insert: Table Name = DPERMT.FACT1 ID = 1714,2
End of section
Optimizer Plan:
INSERT
( 2)
/----/ \
TBSCAN Table:
( 3) DPERMT
| F7KB_F_A_T_Q_B_K
Table:
DTMP1T
F7KB_F_A_T_Q_B_K
> Be careful with LOAD FROM CURSOR, the cursor is a bottle neck. To do that
> in a scalable fashion you would fire up concurrent LOADs on each node
> filtering the source by DBPARTITION.
Does that mean
DECLARE C1 CURSOR for select * from stage where dbpartitionnum(column) = 1
LOAD FROM C1 OF CURSOR INSERT INTO FACT1 ... OUTPUT_DBPARTNUMS 1
DECLARE C2 CURSOR for select * from stage where dbpartitionnum(column) = 2
LOAD FROM C2 OF CURSOR INSERT INTO FACT1 ... OUTPUT_DBPARTNUMS 2
and so on
Thanks
Joachim
>> Hi all,
>>
[quoted text clipped - 62 lines]
> Cheers
> Serge
Serge Rielau - 26 Jan 2005 18:18 GMT
> Optimizer Plan:
>
[quoted text clipped - 7 lines]
> DTMP1T
> F7KB_F_A_T_Q_B_K
Doesn't get easier than that...
>>Be careful with LOAD FROM CURSOR, the cursor is a bottle neck. To do that
>>in a scalable fashion you would fire up concurrent LOADs on each node
>>filtering the source by DBPARTITION.
>
> Does that mean
Connect to node 1:
> DECLARE C1 CURSOR for select * from stage where dbpartitionnum(column) = 1
> LOAD FROM C1 OF CURSOR INSERT INTO FACT1 ... OUTPUT_DBPARTNUMS 1
Connect to node 2:
> DECLARE C2 CURSOR for select * from stage where dbpartitionnum(column) = 2
> LOAD FROM C2 OF CURSOR INSERT INTO FACT1 ... OUTPUT_DBPARTNUMS 2
connect to node "and so on"
> and so on
Basically you are your own splitter.
This, btw is a great way to do batch processing with procedures.
Cheers
Serge

Signature
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab