Tuesday, August 18, 2009

FULL OUTER JOIN

背景
改完某個page,發現load個page時慢到嚇死人,睇返個logic,個bottleneck係有條stored proc行得好慢

邪惡的FULL OUTER JOIN
原來條stored proc入面的query用了FULL OUTER JOIN

Solution
因應情況而嘗試改用UNION ALL,結果係execution plan經已看到,而execution time亦由50s 減到1s

結論:FULL OUTER JOIN 真的很邪惡

1 comment:

Unknown said...

Practically I can't figure out a case that "FULL OUTER JOIN" can be utilized... Is it really a case that MUST/SHOULD use it by the way?