EDW
Last updated
Was this helpful?
Last updated
Was this helpful?
Before creating a temp table, delete the table if already exists (IF OBJECT_ID('TEMP.sg_ALL_TXN') IS NOT NULL DROP TABLE TEMP.sg_ALL_TXN)
While creating table, use distribution (CREATE TABLE TEMP.sg_ALL_TXN WITH (DISTRIBUTION = HASH(CUSTOMER_ID),HEAP) AS DL)
Use table with nolock (WITH(NOLOCK))
Use outz filter for optimization (INNER JOIN FACT_LOAN FL WITH(NOLOCK) ON DL.APPL_ID = FL.APPL_ID AND DL.OUTZ = 20991231120000 AND FL.OUTZ = 20991231120000)
Partition by:
Different methods to remove duplicate rows:
Date related:
Update and take care of performance:
While loop in SQL:
Join in SQL:
SQL Variables:
with(NOLOCK) best practices: