Browse Source

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

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

23
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);
} }
highlimit = siz >> HIGH_SHIFT; if (seqset->seqdata[i].highlimit == 0) {
if (highlimit < HIGH_MIN) { highlimit = siz >> HIGH_SHIFT;
// On the first ever seq record if (highlimit < HIGH_MIN) {
quithere(1, "seqdata[%d] highlimit %d (0x%x) " // On the first ever seq record
"is too small, must be >= %d", quithere(1, "seqdata[%d] highlimit %d "
i, highlimit, highlimit, HIGH_MIN); "(0x%x) is too small, must"
" be >= %d",
i, highlimit, highlimit,
HIGH_MIN);
}
seqset->seqdata[i].highlimit = highlimit;
} }
seqset->seqdata[i].highlimit = highlimit; seqset->seqdata[i].entry = calloc(siz,
seqset->seqdata[i].entry = calloc(siz, sizeof(SEQENTRY)); 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