how to compare costs between two different query. | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

how to compare costs between two different query.

query1 :
SELECT fid
FROM e_syn_test2 , FREETEXTTABLE(e_syn_test2, *, ‘date’, 1000) as KEY_TBL
WHERE fid=KEY_TBL.[KEY] query2 :
SELECT fid, file1, etc
FROM e_syn_test2
where fid in
(
SELECT fid
FROM e_syn_test2 , FREETEXTTABLE(e_syn_test2, *, ‘date’, 1000) as KEY_TBL
WHERE fid=KEY_TBL.[KEY]
)
or
fid in
(
SELECT fid
FROM e_syn_test3, FREETEXTTABLE(e_syn_test3, file_fr, ‘date’, 1000) as KEY_TBL
WHERE fid=KEY_TBL.[KEY]
) I am sure query2 costs more than query1, but how much does it cost more that query1?
is there any software for comparing cost of two queries? Regards
Run the execution plan in Query Analyzer, this will tell you the costs. If you have not done this before, see the Books Online for help on how to do this. —————————–
Brad M. McGehee, MVP
Webmaster
SQL-Server-Performance.Com
the execution plan in Query Analyzer only tells me what part of query costs x% or something.
is it usefule to compare two different queries ?
Yes, because in general cost all execution plan show 100% if one step cost more than 0.
But, you can analize each step to find: Individual cost step, rows returned, if use indexs or not, etc. Also you can run Index Tuning Wizard, using SQL Analyzer, and find index detail actual and suggested.
Luis Martin
Moderator
SQL-Server-Performance.com
You can look at the pages reuited and the time statistics of the queries to comapre them. Gaurav
Moderator
Man thrives, oddly enough, only in the presence of a challenging environment- L. Ron Hubbard

]]>