Is the valid column a varchar column? Normally those columns should be bit columns.
WHERE valid = 1
or
WHERE valid = true (notice no string quotes)
In any case, an index can't do any harm.
Warren Ashcroft
Red Fox UK Limited - Pioneers in Internet Technology
http://www.redfoxuk.com
w.ashcroft [at] redfoxuk.com
NOTE: Forum Private Messaging should not be used to contact staff with support queries.
Whoops - just noticed the last 2 posts on this thread.
Seem to recall from somewhere that indexing field that only holds a couple of values isnt worth indexing, but as Warren says it probably wont do any harm in this case
Adding indexes will speed up queries significant but does add over head as when inserting / updating data then data needs updating in both the table and index. The overhead will be neglible in comparison to the improvements in selecting data.
You need to analyse the queries that your will be running to determine where you need to put indexes.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks