X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=isamc%2Fmerge.c;h=28aa2bf74a4a764279ab9c8494e4159ec98d4af8;hb=f35acdb246c32bc8330fd77104f952711ad1bff5;hp=27281942adc8afbe8cb6a13df0ee152e90734481;hpb=cd0427111b705e414406e1e262f3772e40c7f662;p=idzebra-moved-to-github.git diff --git a/isamc/merge.c b/isamc/merge.c index 2728194..28aa2bf 100644 --- a/isamc/merge.c +++ b/isamc/merge.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: merge.c,v $ - * Revision 1.7 1998-03-11 11:18:18 adam + * Revision 1.8 1998-03-18 09:23:55 adam + * Blocks are stored in chunks on free list - up to factor 2 in speed. + * Fixed bug that could occur in block category rearrangemen. + * + * Revision 1.7 1998/03/11 11:18:18 adam * Changed the isc_merge to take into account the mfill (minimum-fill). * * Revision 1.6 1998/03/06 13:54:03 adam @@ -48,6 +52,31 @@ struct isc_merge_block { int dirty; /* block is different from that on file */ }; +static void opt_blocks (ISAMC is, struct isc_merge_block *mb, int ptr) +{ + int i, no_dirty = 0; + for (i = 0; i mb[j].block) + j_min = j; + } + assert (j_min >= 0); + tmp = mb[j_min].block; + mb[j_min].block = mb[i].block; + mb[i].block = tmp; + mb[i].dirty = 1; + } +} + static void flush_blocks (ISAMC is, struct isc_merge_block *mb, int ptr, char *r_buf, int *firstpos, int cat, int last, int *numkeys) @@ -56,9 +85,6 @@ static void flush_blocks (ISAMC is, struct isc_merge_block *mb, int ptr, for (i = 0; imethod->filecat[cat].ifill - @@ -397,6 +429,8 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I data) ptr, j, cat); ptr = j; border = get_border (is, mb, ptr, cat, firstpos); + if (is->method->debug > 3) + logf (LOG_LOG, "isc: border=%d r_offset=%d", border, r_offset); } } if (mb[ptr].offset < r_offset)