Browse Source

ckdb - key update, discard unneeded generated data

master
kanoi 8 years ago
parent
commit
0114e507b0
  1. 2
      src/ckdb.h
  2. 18
      src/ckdb_dbio.c

2
src/ckdb.h

@ -55,7 +55,7 @@
#define DB_VLOCK "1"
#define DB_VERSION "1.0.7"
#define CKDB_VERSION DB_VERSION"-2.302"
#define CKDB_VERSION DB_VERSION"-2.303"
#define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__

18
src/ckdb_dbio.c

@ -4924,13 +4924,26 @@ flail:
}
k_list_transfer_to_head(new_markersummary_store, markersummary_store);
if (!key_update) {
ks_item = STORE_HEAD_NOLOCK(new_keysummary_store);
while (ks_item) {
// move the new keysummaries into the tree
add_to_ktree(keysummary_root, ks_item);
ks_item = ks_item->next;
}
k_list_transfer_to_head(new_keysummary_store, keysummary_store);
k_list_transfer_to_head(new_keysummary_store,
keysummary_store);
} else {
/* Discard the new data to save RAM,
* since we don't actually use it in key_update */
ks_item = STORE_HEAD_NOLOCK(new_keysummary_store);
while (ks_item) {
free_keysummary_data(ks_item);
ks_item = ks_item->next;
}
k_list_transfer_to_head(new_keysummary_store,
keysummary_free);
}
/* For normal shift processing this wont be very quick
* so it will be a 'long' LOCK */
@ -4996,7 +5009,8 @@ flail:
nonblank ? EMPTY : " ONLY BLANK KEYS");
// This should never happen
if (kshareacc != (shareacc << 1) || kdiffacc != (diffacc << 1)) {
if (!key_update && (kshareacc != (shareacc << 1) ||
kdiffacc != (diffacc << 1))) {
LOGERR("%s() CODE BUG: keysummary share/diff counts "
"are wrong!", shortname);
}

Loading…
Cancel
Save