Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: SQL Query timeout issue

Started 1 month, 2 weeks ago by vishal.todkar
> Hi All, I have two databases, one is Current and another is Archive. A transaction table called “media” is available in both the databases. Child tables are available in Current database only. When user wants to see particular date range records he can select whether to see Current database records or Archive database records. Case 1 When he selects Current database...
Site: SQL Server Forums  SQL Server Forums - site profile
Forum: New to SQL Server  New to SQL Server - forum profile
Total authors: 5 authors
Total thread posts: 10 posts
Thread activity: no new posts during last week
Domain info for: sqlteam.com

Other posts in this thread:

ashishashish replied 1 month, 2 weeks ago
> let us see your query. iF theRe iS a wAy iN tHen theRe iS a wAy oUt..

visakh16 replied 1 month, 2 weeks ago
> are indexes same on both dbs media table?

vishal.todkar replied 1 month, 2 weeks ago
> Thanks for your reply..The INDEXES are same on both dbs "media" table. Vishal

tkizer replied 1 month, 2 weeks ago
> We'll definitely need to see the problematic query. Make sure your statistics are up to date as that's a very important aspect of query performance. UPDATE STATS... Tara Kizer Microsoft MVP for Windows Server System - SQL Server http://weblogs.sqlteam.com/tarad/ Subscribe to my blog "Let's begin with the premise that everything you've done up until this ...

vishal.todkar replied 1 month, 2 weeks ago
> The statistics and indexes are up to date. I understood the issue but not getting solution. Please refer below query. The user has a selection dropdown where he can select how many number of records he want to see (for example 10, 25, 50, 100, 500). Maximum is 500. There is a navigation button where he can click on “Next” to see next set of records. e.g. if he has ...

visakh16 replied 1 month, 2 weeks ago
> replace NOT IN with NOT EXISTS or left join and try

cvraghu replied 1 month, 2 weeks ago
> If your mediaid is sequential, you can store the largest value of mediaid in current resultset in a variable and use it like below - SELECT TOP 10 * FROM yourtables WHERE yourwhereclauses AND m.mediaid > @CurrentMAXMediaID --pass it as parameter from ui order by m.mediaid ,other orderbys Do you think this will work for you?

vishal.todkar replied 1 month, 2 weeks ago
> Thanks Guys. I will try your suggestion on different scenarios and will let you know. Meantime I am trying using ROW_NUMBER() and CTEs. I will post these queries soon. I appreciate your feedback and response. Vishal

visakh16 replied 1 month, 1 week ago
> good luck!

 

Top contributing authors

Name
Posts
vishal.todkar
4
user's latest post:
SQL Query timeout issue
Published (2009-11-11 01:26:00)
> Thanks Guys. I will try your suggestion on different scenarios and will let you know. Meantime I am trying using ROW_NUMBER() and CTEs. I will post these queries soon. I appreciate your feedback and response. Vishal
visakh16
3
user's latest post:
SQL Query timeout issue
Published (2009-11-11 11:59:00)
> good luck!
ashishashish
1
user's latest post:
SQL Query timeout issue
Published (2009-11-09 08:22:00)
> let us see your query. iF theRe iS a wAy iN tHen theRe iS a wAy oUt..
tkizer
1
user's latest post:
SQL Query timeout issue
Published (2009-11-10 01:20:00)
> We'll definitely need to see the problematic query. Make sure your statistics are up to date as that's a very important aspect of query performance. UPDATE STATS... Tara Kizer Microsoft MVP for Windows Server System - SQL Server http://weblogs.sqlteam.com/tarad/ Subscribe to my blog "Let's begin with the premise that everything you've done up until this point is wrong."
cvraghu
1
user's latest post:
SQL Query timeout issue
Published (2009-11-11 00:33:00)
> If your mediaid is sequential, you can store the largest value of mediaid in current resultset in a variable and use it like below - SELECT TOP 10 * FROM yourtables WHERE yourwhereclauses AND m.mediaid > @CurrentMAXMediaID --pass it as parameter from ui order by m.mediaid ,other orderbys Do you think this will work for you?

Related threads on "SQL Server Forums":

Related threads on other sites:

Thread profile page for "SQL Query timeout issue" on http://www.sqlteam.com. This report page is a snippet summary view from a single thread "SQL Query timeout issue", located on the Message Board at http://www.sqlteam.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity