1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Fix for bug#5138: hash indexes on heap tables support statistics.

KEY::rec_per_key is updated every time 1/HEAP_STATS_UPDATE_THRESHOLD part of table records has been changed.


heap/_check.c:
  Hash indexes on heap tables now support statistics - number of hash buckets. The value is updated on any insert/delete operation.
heap/hp_clear.c:
  Hash indexes on heap tables now support statistics - number of hash buckets. The value is updated on any insert/delete operation.
heap/hp_create.c:
  Hash indexes on heap tables now support statistics - number of hash buckets. The value is updated on any insert/delete operation.
heap/hp_delete.c:
  Hash indexes on heap tables now support statistics - number of hash buckets. The value is updated on any insert/delete operation.
heap/hp_hash.c:
  Hash indexes on heap tables now support statistics - number of hash buckets. The value is updated on any insert/delete operation.
heap/hp_write.c:
  Hash indexes on heap tables now support statistics - number of hash buckets. The value is updated on any insert/delete operation.
include/heap.h:
  Hash indexes on heap tables now support statistics - number of hash buckets. The value is updated on any insert/delete operation.
mysql-test/r/heap.result:
  Fix for bug#5138: store/use statistics for hash indexes on heap tables
mysql-test/r/heap_hash.result:
  Fix for bug#5138: store/use statistics for hash indexes on heap tables
mysql-test/r/myisam.result:
  Fix for bug#5138: store/use statistics for hash indexes on heap tables
mysql-test/t/heap_hash.test:
  Fix for bug#5138: store/use statistics for hash indexes on heap tables
sql/structs.h:
  Added comments
This commit is contained in:
unknown
2004-09-08 02:07:53 +04:00
parent c1f297058d
commit 99e1b8179e
14 changed files with 386 additions and 30 deletions

View File

@ -87,6 +87,11 @@ typedef struct st_hp_keydef /* Key definition with open */
uint8 algorithm; /* HASH / BTREE */
HA_KEYSEG *seg;
HP_BLOCK block; /* Where keys are saved */
/*
Number of buckets used in hash table. Used only to provide
#records estimates for heap key scans.
*/
ha_rows hash_buckets;
TREE rb_tree;
int (*write_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo,
const byte *record, byte *recpos);
@ -102,7 +107,7 @@ typedef struct st_heap_share
ulong min_records,max_records; /* Params to open */
ulong data_length,index_length;
uint records; /* records */
uint blength;
uint blength; /* records rounded up to 2^n */
uint deleted; /* Deleted records in database */
uint reclength; /* Length of one record */
uint changed;