Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
538f58c0
Commit
538f58c0
authored
Apr 18, 1997
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#ifdef BTREE_BUILD_STATS enables to get executor stats for btree
building.
parent
d94c7fc4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
17 deletions
+37
-17
src/backend/access/nbtree/nbtree.c
src/backend/access/nbtree/nbtree.c
+18
-14
src/backend/access/nbtree/nbtsort.c
src/backend/access/nbtree/nbtsort.c
+19
-3
No files found.
src/backend/access/nbtree/nbtree.c
View file @
538f58c0
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.1
7 1997/03/24 08:48:11
vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.1
8 1997/04/18 03:37:53
vadim Exp $
*
* NOTES
* This file contains only the public interface routines.
...
...
@@ -33,6 +33,12 @@
# 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 */
...
...
@@ -77,10 +83,6 @@ btbuild(Relation heap,
bool
isunique
;
bool
usefast
;
#if 0
ResetBufferUsage();
#endif
/* note that this is a new btree */
BuildingBtree
=
true
;
...
...
@@ -95,6 +97,11 @@ btbuild(Relation heap,
*/
usefast
=
(
FastBuild
&&
IsNormalProcessingMode
());
#ifdef BTREE_BUILD_STATS
if
(
ShowExecutorStats
)
ResetUsage
();
#endif
/* see if index is unique */
isunique
=
IndexIsUniqueNoCache
(
RelationGetRelationId
(
index
));
...
...
@@ -278,15 +285,12 @@ btbuild(Relation heap,
_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
...
...
src/backend/access/nbtree/nbtsort.c
View file @
538f58c0
...
...
@@ -5,7 +5,7 @@
*
*
* IDENTIFICATION
* $Id: nbtsort.c,v 1.1
4 1997/04/16 01:48:2
7 vadim Exp $
* $Id: nbtsort.c,v 1.1
5 1997/04/18 03:37:5
7 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
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment