In the first index Index page
index, only the PostalCode
is the key column, and AddressLine1, AddressLine2, City, StateProvinceID
are part of the node sheet to avoid key/RID
search
I would prefer the first index when my table is always filtered by PostalCode
, and any of these columns AddressLine1, AddressLine2, City, StateProvinceID
will be part of select
, not filtering
select AddressLine1, AddressLine2, City, StateProvinceID from Person.Address Where PostalCode=
The second index in the Index page
will have five key columns: PostalCode, AddressLine1, AddressLine2, City, StateProvinceID
I would prefer a second index when I have the ability to filter data like
Where PostalCode = And AddressLine1 =
or
Where PostalCode = And AddressLine2 =
or
Where PostalCode = And AddressLine1 = and AddressLine2 =
etc.
In any case, the first column in the index must be part of the filtering to use the index
source share