Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Performance Enhancements

Author  Topic 

kumarpav
Starting Member

18 Posts

Posted - 2004-12-26 : 02:00:11
Hi,
What is Cost Based Optimization and Rule based optimization..
How to find Cost of a query?

Kristen
Test

22859 Posts

Posted - 2004-12-26 : 05:57:14
SET STATISTICS IO ON
SET STATISTICS TIME ON

... put query here

SET STATISTICS IO OFF
SET STATISTICS TIME OFF

you probably need to view results in TEXT mode (in QA), rather than GRID mode. Keep an eye on the Logical IO (rather than the physical IO)

You can clear cache (for level playing field) and to get some physical IO figures, but do **NOT** run these on a Live server!

DBCC DROPCLEANBUFFERS
DBCC FREEPROCCACHE

If you want to see the query plan substitute the command above with:

SET SET SHOWPLAN_TEXT ON
GO

... put query here

GO
SET SET SHOWPLAN_TEXT OFF
GO

See http://www.sql-server-performance.com/statistics_io_time.asp for more details

Kristen
Go to Top of Page
   

- Advertisement -