Browse Source

ckdb - increase seqall highlimit to accommodate different data type processing times

master
kanoi 9 years ago
parent
commit
1adfcb1c51
  1. 15
      src/ckdb.c
  2. 5
      src/ckdb.h

15
src/ckdb.c

@ -2200,8 +2200,10 @@ static bool update_seq(enum seq_num seq, uint64_t n_seqcmd,
for (i = 0; i < SEQ_MAX; i++) { for (i = 0; i < SEQ_MAX; i++) {
// Unnecessary - but as a reminder // Unnecessary - but as a reminder
seqset->seqdata[i].SEQINUSE = 0; seqset->seqdata[i].SEQINUSE = 0;
seqset->seqdata[i].highlimit = 0;
switch (i) { switch (i) {
case SEQ_ALL: case SEQ_ALL:
seqset->seqdata[i].highlimit = SEQ_ALL_HIGHLIMIT;
case SEQ_SHARES: case SEQ_SHARES:
seqset->seqdata[i].size = SEQ_LARGE_SIZ; seqset->seqdata[i].size = SEQ_LARGE_SIZ;
seqset->seqdata[i].timelimit = SEQ_LARGE_TRANS_LIM; seqset->seqdata[i].timelimit = SEQ_LARGE_TRANS_LIM;
@ -2227,15 +2229,20 @@ static bool update_seq(enum seq_num seq, uint64_t n_seqcmd,
"not a power of", "not a power of",
(siz < BASE_SIZ) ? BASE_SIZ : 2); (siz < BASE_SIZ) ? BASE_SIZ : 2);
} }
if (seqset->seqdata[i].highlimit == 0) {
highlimit = siz >> HIGH_SHIFT; highlimit = siz >> HIGH_SHIFT;
if (highlimit < HIGH_MIN) { if (highlimit < HIGH_MIN) {
// On the first ever seq record // On the first ever seq record
quithere(1, "seqdata[%d] highlimit %d (0x%x) " quithere(1, "seqdata[%d] highlimit %d "
"is too small, must be >= %d", "(0x%x) is too small, must"
i, highlimit, highlimit, HIGH_MIN); " be >= %d",
i, highlimit, highlimit,
HIGH_MIN);
} }
seqset->seqdata[i].highlimit = highlimit; seqset->seqdata[i].highlimit = highlimit;
seqset->seqdata[i].entry = calloc(siz, sizeof(SEQENTRY)); }
seqset->seqdata[i].entry = calloc(siz,
sizeof(SEQENTRY));
end = siz * sizeof(SEQENTRY); end = siz * sizeof(SEQENTRY);
off0 = &(seqset->seqdata[i].entry[0]); off0 = &(seqset->seqdata[i].entry[0]);
offn = &(seqset->seqdata[i].entry[siz]); offn = &(seqset->seqdata[i].entry[siz]);

5
src/ckdb.h

@ -51,7 +51,7 @@
#define DB_VLOCK "1" #define DB_VLOCK "1"
#define DB_VERSION "1.0.5" #define DB_VERSION "1.0.5"
#define CKDB_VERSION DB_VERSION"-2.005" #define CKDB_VERSION DB_VERSION"-2.006"
#define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__ #define WHERE_FFL_HERE __FILE__, __func__, __LINE__
@ -1351,6 +1351,9 @@ typedef struct seqset {
#define SEQ_SMALL_TRANS_LIM 64 #define SEQ_SMALL_TRANS_LIM 64
#define SEQ_SMALL_SIZ 16384 #define SEQ_SMALL_SIZ 16384
// Give SEQ_ALL a much higher limit to allow for all type processing times
#define SEQ_ALL_HIGHLIMIT (SEQ_LARGE_SIZ << 3)
// highlimit ratio (shift down bits) // highlimit ratio (shift down bits)
#define HIGH_SHIFT 8 #define HIGH_SHIFT 8
// Smallest highlimit allowed // Smallest highlimit allowed

Loading…
Cancel
Save