?
Solved

SQL Server SLOW results for specific (smaller) date range

Posted on 2011-02-15
3
Medium Priority
?
348 Views
Last Modified: 2012-05-11
I have a view that is comprised of another view and a table. It has 13,493 records. Not that big.

When I do a select ALL records, it takes about 3 seconds to return the dataset.

When I add a WHERE  (LoggedInDate >= '1/1/2010') AND (LoggedInDate <= '12/31/2010') it takes about 3 seconds to return the dataset of 11,172 records.
When I add a WHERE  (LoggedInDate >= '1/1/2011') AND (LoggedInDate <= '12/31/2011')  it takes about 15 seconds to return the dataset of 2,316 records.  At the bottom where it shows # of records its pulling it looks like it is chunking results in sets of 256 at a time.

I traced it back month by month and it looks like it starts this 'chunking' data results for anything loggedindate > 12/15/2010. The LoggedInDate is a datetime field. I checked other views, tables AND even those in different databases and realized that it was happenning to all of them.

Any ideas? Is there a process that was started that is stuck that I may not be seeing?
0
Comment
Question by:Bianca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 32

Accepted Solution

by:
Ephraim Wangoya earned 2000 total points
ID: 34900623

Check if you have created proper index on LoggedInDate
0
 

Author Comment

by:Bianca
ID: 34900632
I hate to ask this but how do I know if its proper indexing?
0
 

Author Comment

by:Bianca
ID: 34900827
Nevermind, got it and it runs in a few seconds, thanks!
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question