Subject Re: Index topic on Firebird book
Author lysander_fb
--- In firebird-support@yahoogroups.com, "jameschua1021"
<cai.haibin@g...> wrote:
> But it
> doesn't mention which side of the table's column should be index? Is
> one side enough?
It depends on the join. Look at the generated plan (for example with
the plan analyser in IBExpert).
Also it depends on how you are limiting the resultset by using WHERE.

If you do a plain left outer join without a WHERE-clause on the left
side an index should not help you too much.

> How is selectivity and statistic related. From the book I learn that
> selectivity that closes to 1 is the better(do we have a treshold here
> as to what is acceptable is a selectivity of .5 still good?)
I think that this _is_ explained in the book, and at least so that _I_
could understand it.

selectivity of 0.5 means that in average you do have 2 records per
index-key. And that should not be a problem. There are more functions
to find out if this average is outweighted by extreme high
duplications of only a few fields.
Check your documentation and your management-tool for
functions/statistics about "duplications" or "dupes" ... something
like that.

ciao,
André