Best index(es) to use for an OR Statement in SQL Server
Posted
by Chuck Haines
on Stack Overflow
See other posts from Stack Overflow
or by Chuck Haines
Published on 2010-06-16T15:19:20Z
Indexed on
2010/06/16
15:22 UTC
Read the original article
Hit count: 160
sql-server
|sql-server-2008
I have a table which has a bunch of columns but the two relevant ones are:
Due_Amount MONEY
Bounced_Due_Amount MONEY
I have a SQL query like the following
SELECT * FROM table WHERE (Due_Amount > 0 OR Bounced_Due_Amount > 0)
Would the best index to put on this table for SQL Server 2008 be an index which includes both columns in the index, or should I put an separate index on each column?
© Stack Overflow or respective owner