I know that in the case of some database engines a two-column index can
also be used to speed searches on the first of the two indexed columns
when searched singly, thereby making it unnecessary to create a
separate index on the first column.
For example, a two-column index in (lastname,firstname) will also be
used by those searches that search only on the 'lastname' field, so
that a separate one-column index on 'lastname' is not necessary.
Is this the case with SQL-Server?It is. Statistics are kept for the first column in a composite index.
ML
http://milambda.blogspot.com/|||Yes.
Roji. P. Thomas
Net Asset Management
http://toponewithties.blogspot.com
<quizling@.biztekinc.net> wrote in message
news:1136758766.471031.129740@.g14g2000cwa.googlegroups.com...
>I know that in the case of some database engines a two-column index can
> also be used to speed searches on the first of the two indexed columns
> when searched singly, thereby making it unnecessary to create a
> separate index on the first column.
> For example, a two-column index in (lastname,firstname) will also be
> used by those searches that search only on the 'lastname' field, so
> that a separate one-column index on 'lastname' is not necessary.
> Is this the case with SQL-Server?
>
Thursday, February 16, 2012
Can a multi-column index be used for single-column searching?
Labels:
canalso,
case,
columnswhen,
database,
engines,
index,
indexed,
microsoft,
multi-column,
mysql,
oracle,
searches,
searching,
server,
single-column,
speed,
sql,
two-column
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment