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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Slow Query
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

68 Posts

Posted - 09/25/2012 :  10:32:15  Show Profile  Reply with Quote
select * from table
where Column like '' or Column like ' ' or Column is null

the table has 23 Lakh rows
i have two primary keys in the table

the query is taking almost 12 minutes to run. Is there a was i can speed this up?

Flowing Fount of Yak Knowledge

4614 Posts

Posted - 09/25/2012 :  10:55:18  Show Profile  Reply with Quote
What is teh DDL of the table? Do you have any indexes on the table?

Just as a side note, the default settings for SQL is to ignore trailing spaces so: Column like '' or Column like ' ', is redundant.

Here are some links that might help give you more information about what you can post that will help us help you:
Go to Top of Page

Posting Yak Master

212 Posts

Posted - 09/26/2012 :  06:23:53  Show Profile  Visit prett's Homepage  Reply with Quote
The reason behind Slow query performance are due to the load on the system, and other times it is because the query is not written to perform as efficiently as possible. Please take a look of this article to improve query performance:
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000