WHEN TO USE WHICH JOIN OPTION FOR FASTER JOIN OPERATIONS?
MERGE JOIN: APPLICCABLE FOR LARGER TABLES
LOOP JOIN: APPLICABLE FOR SMALLER TABLES
HASH JOIN: APPLICABLE FOR TABLES WITH UNKNOWN SIZE PARAMETERS
SELECT * FROM SALES_DATA
JOIN
PRODUCTS_DATA
ON
PRODUCTS_DATA.ProductKey = SALES_DATA.ProductKey
OPTION (MERGE JOIN)
SELECT * FROM SALES_DATA
JOIN
PRODUCTS_DATA
ON
PRODUCTS_DATA.ProductKey = SALES_DATA.ProductKey
OPTION (HASH JOIN)
MERGE JOIN: APPLICCABLE FOR LARGER TABLES
LOOP JOIN: APPLICABLE FOR SMALLER TABLES
HASH JOIN: APPLICABLE FOR TABLES WITH UNKNOWN SIZE PARAMETERS
SELECT * FROM SALES_DATA
JOIN
PRODUCTS_DATA
ON
PRODUCTS_DATA.ProductKey = SALES_DATA.ProductKey
OPTION (MERGE JOIN)
SELECT * FROM SALES_DATA
JOIN
PRODUCTS_DATA
ON
PRODUCTS_DATA.ProductKey = SALES_DATA.ProductKey
OPTION (HASH JOIN)
0 comments: