Subject Re: [Firebird-Architect] RFC: RDB$COUNT
Author Ann W. Harrison
= m. Th = wrote:
>>>
>> ... the count fields were serious hot-spots
>> since every committing transaction had to update the same field.
>>
> I did some tests and isn't a (visible) performance hit. I simulated
> updating the RDB$COUNT by a script like ..

The performance problem isn't with a single transaction, but with
50 or more transactions changing the same tables at the same time.


>>
> Transaction context. It reflects how the current transaction changes the
> table RecCount.

The problems with that are wrong answers and deadlocks. A transaction
won't see changes made by concurrent transactions. When it com
>>>
>> Statistics refers to the selectivity of indexes, not the cardinality
>> of tables.
>>
> Selectivity isn't (number of entries in a index) / (table reccount)?

No, selectivity is the number of distinct key values in the index
divided by the total number of entries in the index. There may be
multiple entries in the index for a single record if the key value
has changed.


Regards,


Ann