Definitely create one index that includes all three columns!
The fewer indexes you have, the better - index maintenance is a cost factor - more indices require more maintenance.
And the included columns are included in the leaf level of the index only - the have only a very marginal impact on performance.
Update: if you have a single index on (tblID, column_A)
, then you can use this for queries that use only tblID
in their WHERE
clause, or you can use it for queries that use both columns in their WHERE
clause.
HOWEVER: this index is useless for queries that use only column_A
in their WHERE
clause. A compound index (index made up from multiple columns) is only ever useful if a given query uses the n left-most columns as specified in the index.
So in your case, one query seems to indicate tblID
, while the other needs (tblID, column_A)
- so yes, in this case, I would argue a single index on (tblID, column_A)
would work for both queries.