You are here: Query optimization via table properties? « MsSQL Server « IT news, forums, messages
Query optimization via table properties?

Posted by Ed Murphy on 07/26/06 16:39

Query #1:

select <list of fields>
from C
join B on C.b_key = B.b_key
join A on B.a_key = A.a_key
where A.o_key = <some value>

Query #2:

select <list of fields>
from C
where b_key in (
select b_key
from B
where a_key in (
select a_key
from A
where o_key = <some value>
)
)

#1 (and other things with the same general pattern) are used in
literally thousands of places in this one client's system, and is
much nicer to write, but seems to be rather slower than #2. Is
there any way to tweak the tables to tell the system something
like "hey, B, whenever you're joined to A, you should seriously
consider waiting for A to be filtered down to a manageable level
first"? And similarly for C/B.

MS SQL 2000, SP3, 6.5 compat mode. These are set in stone until
we upgrade the accounting software (highly non-trivial).

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация