Skip to content

Commit

Permalink
Made an optimisation to the raw staging layer
Browse files Browse the repository at this point in the history
- Added a join in the raw inventory table on the raw orders table to ensure only inventory items which are included in orders are fed into raw staging.
  • Loading branch information
Alex Higgs committed Nov 7, 2019
1 parent ea3e680 commit eaa6714
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions models/load/raw/raw_inventory.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ left join SNOWFLAKE_SAMPLE_DATA.TPCH_SF10.SUPPLIER as b on a.PS_SUPPKEY=b.S_SUPP
left join SNOWFLAKE_SAMPLE_DATA.TPCH_SF10.PART as c on a.PS_PARTKEY=c.P_PARTKEY
left join SNOWFLAKE_SAMPLE_DATA.TPCH_SF10.NATION as d on b.S_NATIONKEY=d.N_NATIONKEY
left join SNOWFLAKE_SAMPLE_DATA.TPCH_SF10.REGION as e on d.N_REGIONKEY=e.R_REGIONKEY
join {{ ref('raw_orders') }} as f on a.PS_PARTKEY = f.PARTKEY and a.PS_SUPPKEY=f.SUPPLIERKEY
order by a.PS_PARTKEY, a.PS_SUPPKEY

0 comments on commit eaa6714

Please sign in to comment.