Ray said:
No, what I mean was why have ALL three properties at No.
My apologies. I didn't mean to imply you're only concerned with ignoring
nulls in an index. I'm sure you're aware indexes don't have to be primary
keys or unique to be useful so I focused my explanation on the *ignoring
nulls* part.
I ask why is it necessary if all three
properties are at No.
Ok, say I have a table of 10,000 customers which includes their addresses.
If I put an index on the state column, it won't be the primary key and it
won't be unique, will it? No, so both those settings will be no. If I also
set ignore nulls to no on this index I'll have to include the state for every
record. If I set ignore nulls to yes I can leave some of those records
without a state for the customer's address. Let's see what would happen if I
set this index to ignore nulls (= yes):
In queries I won't be able to join on the state column and get *all* the
records where the state is null because null is never equal to anything, not
even to null. Being indexed if I use state in the criteria (the where column)
, Jet doesn't have to do a full table scan to find all the records with NY in
the state column. Jet just gets the records whose index is 'NY' and ignores
the other records in the table. If most or all the records are 'NY' then
this won't save time over a full table scan, but if there are fewer then
retrieving *just* the 'NY' records with the index will be faster.
What if I set ignore nulls to no? I can still use the index to retrieve
those 'NY' records faster than using a full table scan would retrieve those
'NY' records. It's just that *all* the records will have a state identified
in the customer's address in this case (which means that I might have more
records with 'NY' as the state than if I allowed nulls in this column, but
that's not a good enough reason to always use a full table scan to pick out
the 'NY' records in the table).
So the index would still be useful to speed up my queries with all three
settings on no. Whether I want to allow nulls or not in that index is a
separate issue.