![]() |
| ||
| SQL Query takes lot of time Hi evrybody, My sql SP takes around two to three minutes which is quite long time to execute the SP select data from three tables publicity(29000 row) publicitysubject(29000 row) & lookuptable(50 rows) all three tables have clustered index How can i reduce the time
|
| ||
| Re: SQL Query takes lot of time Just because an index is clustered doesn't necessarily mean it is the best index to use. If you store a large amount of data in the tables, especially if you use varchar(max), text, or image data types, then you should probably create another nonclustered index on the joining identifiers. A clustered index will cover blob data and make the row seeking perform very slowly. You should run the sprocs as TSQL and have the SQL Server Management Studio output an execution plan. CTLR+M = "Display actual execution plan" then save the execution plan, upload it, and i'll take a look at it. |
| ||
| Re: SQL Query takes lot of time thanks sknake, I am attaching the execution plan |
| ||
| Re: SQL Query takes lot of time write some part of execution plan 1)Select cost 0% 2)Merge Join(inner join) cost 0% 3)Nested Loop(inner join) cost 11% 4)Sort 1% 5)Hash Match(inner join) 13% 6)Clustered index publicity cost 67% 7)clustered index publicitysubject 13% 8)clustered index lookup 0% clustred index country 0% |
| ||
| Re: SQL Query takes lot of time Please ATTACH the execution plan as a file and also post the create table ()statements for your tables with the indexes. This doesn't look like a complicated fix but I'm missing information. |
| All times are GMT -4. The time now is 5:47 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC