Subject Re: Re[2]: [firebird-support] Re: Performance with indices
Author Arno Brinkman
Hi,

> AB> The selectivity is calculated as :
> AB> 1 / (Total Number of index nodes / Number of duplicated nodes)
>
> So, selectivity and FB's statistics of an index mean the same. (in my
> previous post I used Adam's definition for the selectivity, and I
> tried to correlate that definition to FB's statistics)

SET STATISITICS INDEX <name> updates the field RDB$STATISTICS in the index tables. Which we also call the selectivity.

selectivity * estimated total records = estimated records to fetch.

> What about a unique index? In the original post Alexandre says that
> PK stays active while he perform a bulk insert... Should he recompute
> the statistics during the bulk insert? Could it improve the insert
> performance?

Indexes controled by a constraint (PK/FK/U) cannot be disabled thus will stay active.
For inserts no indexes are used, so i don't see how this could improve insert performance or i misunderstood your
question?
The selectivity is only used at the optimizer-phase. After a statement has been prepared it has no impact if the
selectivity changes.

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General database developer support:
http://www.databasedevelopmentforum.com

Firebird open source database (based on IB-OE) with many SQL-99 features:
http://www.firebirdsql.org
http://www.firebirdsql.info

Support list for Interbase and Firebird users:
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep:
news://newsgroups.firebirdsql.info