Re: Update Statistics
Posted in 1993
Naomi Walker writes: |> From what I know, one of the main reasons to run update statistics is |> to not only update the number of rows in the system catalogs, but to |> update the min and max index values. |> |> I really dont understand why this information cannot be kept up to date |> at all times. I'm guessing there is a performance hit, but if this |> information was kept in shared memory, it should be pretty fast and |> painless. But then, I say this not knowing the internals. Actually second min and second max are easy: since they are only kept for columns that are index keys, we just use the index itself to grab these values. What takes most of the time is counting the unique number of keys in the tree (which requires a full traversal of the tree). To keep that info in real time would slow down insert/update/delete performance far too much to make it viable - the issue is not so much changing it, which would not be that bad, but the bottleneck of all the users trying to update that same value whenever they made a change to a table. Dave