perf(selfop): stabilize profile candidate join order
This commit is contained in:
+2
-1
@@ -56,7 +56,8 @@ public interface OutboundAggregateMapper {
|
||||
MAX(CASE WHEN outbound_rank=1 THEN observation_run_id END) evidence_run_id,
|
||||
MAX(CASE WHEN seen_rank=1 THEN observation_run_id END) last_seen_run_id
|
||||
FROM (
|
||||
SELECT o.customer_code,i.sku_code,i.product_name,i.quantity_unit,o.outbound_at_utc,
|
||||
SELECT /*+ JOIN_ORDER(o,i,s,r,t) INDEX(s idx_selfop_stage_fact_observation) */
|
||||
o.customer_code,i.sku_code,i.product_name,i.quantity_unit,o.outbound_at_utc,
|
||||
s.observed_at_utc,s.run_id observation_run_id,
|
||||
ROW_NUMBER() OVER (PARTITION BY o.customer_code,i.sku_code ORDER BY o.outbound_at_utc,o.id) outbound_rank,
|
||||
ROW_NUMBER() OVER (PARTITION BY o.customer_code,i.sku_code ORDER BY s.observed_at_utc DESC,s.id DESC) seen_rank
|
||||
|
||||
Reference in New Issue
Block a user