The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

ATTN db gurus by imrambi2008-10-21 10:58:29
  db index optimization is a big topic. by ManiacJoe 2008-10-21 12:12:50
The order of the columns in the WHERE clause will not affect the index(es) used.

Choosing the order of the columns in the compound index gets tricky. If columnA can be used without columnB in many of the other WHERE clauses in your system, putting columnA first will allow the optimizer to use ColumnA+ColumnB without the need for a separate singling index on ColumnA. However, if ColumnA and ColumnB are very frequently used together in WHERE clauses, it would be better to place the more randomly distributed column first in the index, which would conflict with the previous optimization.
[ Reply ]

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)