Subject | Re: [IB-Architect] Index Sync/Rebuild Question |
---|---|
Author | Ann Harrison |
Post date | 2000-04-28T14:49:33Z |
At 11:40 AM 4/28/00 +0200, Paul Reeves wrote:
level from beginning to end. The only time that's done, during
normal processing, is to support an "order by" of the whole
table. I suppose that the selectivity could be reset when such
an operation occurred.
secondary benefits) or just resetting the selectivity.
They're not stored in the index itself.
Ann
> >Computing the selectivity of an index requires reading the leaf
> > Paul Reeves wrote:
> > > I have often wondered why the engine doesn't automatically recompute
> > > these values.
level from beginning to end. The only time that's done, during
normal processing, is to support an "order by" of the whole
table. I suppose that the selectivity could be reset when such
an operation occurred.
>Except for one very common situation. Create your database. Populate it withAs with deactivating and reactivating the indexes (which can have
>data. Start using it. Then check the selectivity. You will find that almost
>every index will have 0 - the selectivity that existed when the db was
>created.
>Of course a backup and restore will fix this.
secondary benefits) or just resetting the selectivity.
>How much significance all this has depends on the question 'How much credenceActually, gstat does a pass over the index and creates those numbers.
>does the optimiser give to the selectivity as stored in rdb$indices.'
>If you
>look at the output of gstat it is evident that the index stores a close
>approximation of the actual number of unique values ( nodes - total_dup ).
>Therefore it can ignore the rdb$statisitics column entirely.
They're not stored in the index itself.
>My guess (hope) is that the optimiser will start with the rdb$statisticsNo. The plan is chosen before the index is examined.
>column
>and revise its plan upon actually looking at the indexes chosen for the
>plan if
>there is a wild divergence. Assuming, that is, that looking up
>rdb$statistics is
>quicker than looking at the cached index structures.
>It seems to me that if rdb$statistics is important then it should beAs long as it doesn't wipe out the cache.
>maintained,
>especially under super server. What else are background, low priority threads
>for?
Ann