add indexes and filter the merge
This commit is contained in:
parent
e3b21b0898
commit
35e7ce0f99
@ -26,6 +26,26 @@ CREATE TABLE pricequote.queue (
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
CREATE INDEX idx_osm_stack_merge
|
||||||
|
ON rlarp.osm_stack (
|
||||||
|
bill_cust,
|
||||||
|
ship_cust,
|
||||||
|
part,
|
||||||
|
stlc,
|
||||||
|
dataseg,
|
||||||
|
qtyord
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE INDEX idx_queue_merge
|
||||||
|
ON pricequote.queue (
|
||||||
|
bill,
|
||||||
|
ship,
|
||||||
|
part,
|
||||||
|
stlc,
|
||||||
|
v1ds,
|
||||||
|
vol
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
--DROP PROCEDURE IF EXISTS pricequote.process_queue;
|
--DROP PROCEDURE IF EXISTS pricequote.process_queue;
|
||||||
|
|
||||||
@ -56,6 +76,7 @@ BEGIN
|
|||||||
AND o.part IS NOT NULL
|
AND o.part IS NOT NULL
|
||||||
AND substring(o.glec, 1, 1) <= '2';
|
AND substring(o.glec, 1, 1) <= '2';
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
-- Step 2: Enrich customer, tier, channel, pack quantity, and level
|
-- Step 2: Enrich customer, tier, channel, pack quantity, and level
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
@ -228,7 +249,12 @@ BEGIN
|
|||||||
AND o.part = q.part
|
AND o.part = q.part
|
||||||
AND o.stlc = q.stlc
|
AND o.stlc = q.stlc
|
||||||
AND o.dataseg = q.v1ds
|
AND o.dataseg = q.v1ds
|
||||||
AND o.qtyord = q.vol;
|
AND o.qtyord = q.vol
|
||||||
|
AND o.fs_line = '41010'
|
||||||
|
AND o.calc_status <> 'CANCELLED'
|
||||||
|
AND o.version IN ('Actual', 'Forecast', 'Quotes')
|
||||||
|
AND o.part IS NOT NULL
|
||||||
|
AND substring(o.glec, 1, 1) <= '2';
|
||||||
|
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
-- Done
|
-- Done
|
||||||
|
Loading…
Reference in New Issue
Block a user