Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Enterprise
Expertise: Beginner
Nov 9, 1999

Construct Proper SQL Queries to Improve Performance

Use of inequality operators in SQL queries force databases to use table scans to evaluate the inequalities. These queries generate high I/O if they run regularly against large tables. You should avoid SQL query that is using expression with NOT in it. If these queries must be run, then restructure the queries to eliminate the NOT keyword or operator. Instead of using:
 
SELECT * FROM MyTable WHERE col1 != 'value'
Use:
 
SELECT * FROM MyTable WHERE col1 < 'value' or col1 > 'value'
Jai Bardhan
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date