*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.17 1997/03/24 08:48:11 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.18 1997/04/18 03:37:53 vadim Exp $
*
* NOTES
* This file contains only the public interface routines.
# include <string.h>
#endif
+#ifdef BTREE_BUILD_STATS
+#include <tcop/tcopprot.h>
+extern int ShowExecutorStats;
+#endif
+
+
bool BuildingBtree = false; /* see comment in btbuild() */
bool FastBuild = true; /* use sort/build instead of insertion build */
bool isunique;
bool usefast;
-#if 0
- ResetBufferUsage();
-#endif
-
/* note that this is a new btree */
BuildingBtree = true;
*/
usefast = (FastBuild && IsNormalProcessingMode());
+#ifdef BTREE_BUILD_STATS
+ if ( ShowExecutorStats )
+ ResetUsage ();
+#endif
+
/* see if index is unique */
isunique = IndexIsUniqueNoCache(RelationGetRelationId(index));
_bt_spooldestroy(spool);
}
-#if 0
+#ifdef BTREE_BUILD_STATS
+ if ( ShowExecutorStats )
{
- extern int ReadBufferCount, BufferHitCount, BufferFlushCount;
- extern long NDirectFileRead, NDirectFileWrite;
-
- printf("buffer(%d): r=%d w=%d\n", heap->rd_rel->relblocksz,
- ReadBufferCount - BufferHitCount, BufferFlushCount);
- printf("direct(%d): r=%d w=%d\n", LocalBlockSize,
- NDirectFileRead, NDirectFileWrite);
+ fprintf(stderr, "! BtreeBuild Stats:\n");
+ ShowUsage ();
+ ResetUsage ();
}
#endif
-
+
/*
* Since we just counted the tuples in the heap, we update its
* stats in pg_class to guarantee that the planner takes advantage
*
*
* 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
*
# include <string.h>
#endif
+#ifdef BTREE_BUILD_STATS
+#include <tcop/tcopprot.h>
+extern int ShowExecutorStats;
+#endif
+
/*
* turn on debugging output.
*
{
tape->bttb_eor = eor;
FileWrite(tape->bttb_fd, (char *) tape, TAPEBLCKSZ);
- NDirectFileWrite += TAPEBLCKSZ;
+ NDirectFileWrite += TAPEBLCKSZ/MAXBLCKSZ;
_bt_tapereset(tape);
}
return(0);
}
Assert(tape->bttb_magic == BTTAPEMAGIC);
- NDirectFileRead += TAPEBLCKSZ;
+ NDirectFileRead += TAPEBLCKSZ/MAXBLCKSZ;
return(1);
}
_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);
+
}