To improve speed:
- use In-line views (virtual tables)
- sort data before combining with another in-line view
- don't move any data forward that isn't necessary (old keys)
- collapse all data as soon as possible
Select A.Name, A.City, B.DescriptionFaster:
From Master A
Join Reference B
Using (Name)
Where Zip = '22042';
Select A.Name, A.City, B.Description
From
(
Select Name, City
From Master
Where Zip = '22042'
Order By Name
) A
Join
(
Select Name, Descripition
From Reference
Where Zip = '22042'
Order By Name
) B
Using (Name);
Tiny link to this post: http://tinyurl.com/fast-query
No comments:
Post a Comment