Groups | Blog | Home
all groups > sql server programming > may 2006 >

sql server programming : Optimize the query performance


Jim Underwood
5/19/2006 1:23:40 PM
Sorry, but what are lakhs and crores?

Also, post DDL for your table and indexes, along with your query. See
instructions here:
http://www.aspfaq.com/etiquette.asp?id=5006

[quoted text, click to view]

Jim Underwood
5/19/2006 2:24:38 PM
Gert-Jan,
Thanks for the link.

[quoted text, click to view]

Gert-Jan Strik
5/19/2006 8:05:11 PM
Pushkar,

The nonclustered index on StartTime is probably not useful. Currently,
the query is probably using a table scan (or clustered index scan) which
will take more time as the table grows. Then can check this by viewing
the query plan.

If you make the index on StartTime the clustered index, then only these
rows will be read when copying a date range. After that, maybe the query
will finish within the timeout period of 60 seconds.

HTH,
Gert-Jan

P.S. Jim, you might want to have a look at
http://en.wikipedia.org/wiki/Lakh This page also explains crores.


[quoted text, click to view]
Pushkar
5/19/2006 10:21:20 PM
Hi,

I am saving the data of profiler into trace table every day and then export
this data into table called RepositoryTable.
RepositoryTable has exactly same structure as profiler trace table.
Every day I am inserting 10 lakhs rows of trace events in the Repository
table.

Repository table has primary key on RowNumber and non clustered index on
StartTime column.

I have specified timeout interval as 60 seconds.
I have a simple query based on time range filter only, but this query too
timeout after 60 seconds.
How can I optimize my query to get the best performance?
Is timeout interval too small? What should be optimum timeout interval
assuming repository table will have 10 crores of rows within some time
period?
What is optimum interval to update the statistics of the table?


Thanks in advance.
Pushkar


AddThis Social Bookmark Button