diff options
Diffstat (limited to 'src/backend/access/nbtree/nbtsort.c')
| -rw-r--r-- | src/backend/access/nbtree/nbtsort.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c index 6e382982a9..978e73d331 100644 --- a/src/backend/access/nbtree/nbtsort.c +++ b/src/backend/access/nbtree/nbtsort.c @@ -5,7 +5,7 @@ * * * IDENTIFICATION - * $Id: nbtsort.c,v 1.14 1997/04/16 01:48:27 vadim Exp $ + * $Id: nbtsort.c,v 1.15 1997/04/18 03:37:57 vadim Exp $ * * NOTES * @@ -63,6 +63,11 @@ # include <string.h> #endif +#ifdef BTREE_BUILD_STATS +#include <tcop/tcopprot.h> +extern int ShowExecutorStats; +#endif + /* * turn on debugging output. * @@ -427,7 +432,7 @@ _bt_tapewrite(BTTapeBlock *tape, int eor) { tape->bttb_eor = eor; FileWrite(tape->bttb_fd, (char *) tape, TAPEBLCKSZ); - NDirectFileWrite += TAPEBLCKSZ; + NDirectFileWrite += TAPEBLCKSZ/MAXBLCKSZ; _bt_tapereset(tape); } @@ -463,7 +468,7 @@ _bt_taperead(BTTapeBlock *tape) return(0); } Assert(tape->bttb_magic == BTTAPEMAGIC); - NDirectFileRead += TAPEBLCKSZ; + NDirectFileRead += TAPEBLCKSZ/MAXBLCKSZ; return(1); } @@ -1366,5 +1371,16 @@ void _bt_leafbuild(Relation index, void *spool) { _bt_isortcmpinit (index, (BTSpool *) spool); + +#ifdef BTREE_BUILD_STATS + if ( ShowExecutorStats ) + { + fprintf(stderr, "! BtreeBuild (Spool) Stats:\n"); + ShowUsage (); + ResetUsage (); + } +#endif + _bt_merge(index, (BTSpool *) spool); + } |
