page215
301
Figure 8-19.
Concurrent processing pattern
This example uses five partition tables, which may reduce the warehouse size
from Medium to Small. As recommended throughout this book, testing will determine
the optimal warehouse size, and any suggestion on appropriate warehouse size must
be proven.
With five partition tables, you will require five streams, five tasks, and a single
parameterized stored procedure.
You must create streams before populating raw or staging tables with data to ensure
each stream registers the loaded data.
DMl order is significant: truncate before creating streams.
To ensure the steams are populated, you first use
TRUNCATE
on the staging table
stg_
customer_order
and then reload each data set for
INSERT
,
UPDATE
, and
DELETE
.
TRUNCATE TABLE stg_customer_order;
Create five streams on the raw or staging table, one for each target partition table.
CREATE OR REPLACE STREAM strm_part_customer_order_asia
ON TABLE stg_customer_order;
CREATE OR REPLACE STREAM strm_part_customer_order_europe
ON TABLE stg_customer_order;
CREATE OR REPLACE STREAM strm_part_customer_order_africa
ON TABLE stg_customer_order;
CREATE OR REPLACE STREAM strm_part_customer_order_america
ON TABLE stg_customer_order;
CREATE OR REPLACE STREAM strm_part_customer_order_middle_east
ON TABLE stg_customer_order;
Chapter 8
parallelization