Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Everybody,

I have a query which performance i need to improve.
I want to share your experience.

The Query is :

Select * from Customer C where 1=1 AND NOT EXISTS (Select * from Members).
Posted
Comments
Jibesh 14-Dec-12 14:03pm    
It's really hard to explain with this limited information. without knowing the columns of the table no one could fine tune your query.

SQL Query Optimization is a huge topic and I believe you did some research googling for query optimization is a good way to start
Jörgen Andersson 15-Dec-12 16:13pm    
1 = 1 is completely pointless.
Your subquery does not have any condition, so your query will not have any result if there are any rows at all in Members table. And if the members table is empty the result will be the complete Customer table.
There is nothing to tune in this query.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900