View Single Post
Old 10-02-2009, 12:44 PM   #16
Bobblehead
Franchise Player
 
Bobblehead's Avatar
 
Join Date: Jul 2005
Location: in your blind spot.
Exp:
Default

Quote:
Originally Posted by Jedi Ninja View Post
I'm no DBA, but I think the most efficient and simplest way to tackle this problem is to create a table called Users_With_Clue (and move Clue into that table) and do an inner join against the Users table. As the Users_With_Clue table will always be empty, you'll get the fastest execution times on that SELECT statement plus save the overhead of having to maintain the index. You'll also save all that space you're wasting storing all those zero values, for that matter.

I'm sure this is why the Hooters waitress was confused by the shirt.
While you have a point, a bitmap index on the column and you'll be fine without needing to code a join. And that column will probably be filled with null which won't take up any space; so unless you've set your pct_free/pct_used really wacky there won't be much chance of chained rows. Sometimes we DBAs need to denormalize to keep things easy for the code monkeys maintain the data structure.
__________________
"The problem with any ideology is that it gives the answer before you look at the evidence."
—Bill Clinton
"The greatest obstacle to discovery is not ignorance--it is the illusion of knowledge."
—Daniel J. Boorstin, historian, former Librarian of Congress
"But the Senator, while insisting he was not intoxicated, could not explain his nudity"
—WKRP in Cincinatti
Bobblehead is offline   Reply With Quote