File tree 5 files changed +17
-29
lines changed 5 files changed +17
-29
lines changed Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/storage/buffer/buf_init.c,v 1.80 2008/01/01 19:45:51 momjian Exp $
11
+ * $PostgreSQL: pgsql/src/backend/storage/buffer/buf_init.c,v 1.81 2008/09/17 13:15:55 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -29,6 +29,8 @@ long int BufferHitCount;
29
29
long int LocalBufferHitCount ;
30
30
long int BufferFlushCount ;
31
31
long int LocalBufferFlushCount ;
32
+ long int BufFileReadCount ;
33
+ long int BufFileWriteCount ;
32
34
33
35
34
36
/*
Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.237 2008/08/11 11:05:11 heikki Exp $
11
+ * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.238 2008/09/17 13:15:55 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -64,12 +64,6 @@ bool zero_damaged_pages = false;
64
64
int bgwriter_lru_maxpages = 100 ;
65
65
double bgwriter_lru_multiplier = 2.0 ;
66
66
67
-
68
- long NDirectFileRead ; /* some I/O's are direct file access. bypass
69
- * bufmgr */
70
- long NDirectFileWrite ; /* e.g., I/O in psort and hashjoin. */
71
-
72
-
73
67
/* local state for StartBufferIO and related functions */
74
68
static volatile BufferDesc * InProgressBuf = NULL ;
75
69
static bool IsForInput ;
@@ -1572,7 +1566,7 @@ ShowBufferUsage(void)
1572
1566
ReadLocalBufferCount - LocalBufferHitCount , LocalBufferFlushCount , localhitrate );
1573
1567
appendStringInfo (& str ,
1574
1568
"!\tDirect blocks: %10ld read, %10ld written\n" ,
1575
- NDirectFileRead , NDirectFileWrite );
1569
+ BufFileReadCount , BufFileWriteCount );
1576
1570
1577
1571
return str .data ;
1578
1572
}
@@ -1586,8 +1580,8 @@ ResetBufferUsage(void)
1586
1580
LocalBufferHitCount = 0 ;
1587
1581
ReadLocalBufferCount = 0 ;
1588
1582
LocalBufferFlushCount = 0 ;
1589
- NDirectFileRead = 0 ;
1590
- NDirectFileWrite = 0 ;
1583
+ BufFileReadCount = 0 ;
1584
+ BufFileWriteCount = 0 ;
1591
1585
}
1592
1586
1593
1587
/*
Original file line number Diff line number Diff line change 7
7
* Portions Copyright (c) 1994, Regents of the University of California
8
8
*
9
9
* IDENTIFICATION
10
- * $PostgreSQL: pgsql/src/backend/storage/file/buffile.c,v 1.31 2008/05/02 01:08:27 tgl Exp $
10
+ * $PostgreSQL: pgsql/src/backend/storage/file/buffile.c,v 1.32 2008/09/17 13:15:55 tgl Exp $
11
11
*
12
12
* NOTES:
13
13
*
36
36
37
37
#include "storage/fd.h"
38
38
#include "storage/buffile.h"
39
+ #include "storage/buf_internals.h"
39
40
40
41
/*
41
42
* We break BufFiles into gigabyte-sized segments, regardless of RELSEG_SIZE.
@@ -238,6 +239,8 @@ BufFileLoadBuffer(BufFile *file)
238
239
file -> nbytes = 0 ;
239
240
file -> offsets [file -> curFile ] += file -> nbytes ;
240
241
/* we choose not to advance curOffset here */
242
+
243
+ BufFileReadCount ++ ;
241
244
}
242
245
243
246
/*
@@ -300,6 +303,8 @@ BufFileDumpBuffer(BufFile *file)
300
303
file -> offsets [file -> curFile ] += bytestowrite ;
301
304
file -> curOffset += bytestowrite ;
302
305
wpos += bytestowrite ;
306
+
307
+ BufFileWriteCount ++ ;
303
308
}
304
309
file -> dirty = false;
305
310
Original file line number Diff line number Diff line change 10
10
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
11
11
* Portions Copyright (c) 1994, Regents of the University of California
12
12
*
13
- * $PostgreSQL: pgsql/src/include/executor/execdebug.h,v 1.32 2008/01/01 19:45:57 momjian Exp $
13
+ * $PostgreSQL: pgsql/src/include/executor/execdebug.h,v 1.33 2008/09/17 13:15:55 tgl Exp $
14
14
*
15
15
*-------------------------------------------------------------------------
16
16
*/
@@ -190,19 +190,4 @@ extern int NIndexTupleInserted;
190
190
#define MJ_DEBUG_PROC_NODE (slot )
191
191
#endif /* EXEC_MERGEJOINDEBUG */
192
192
193
- /* ----------------------------------------------------------------
194
- * DO NOT DEFINE THESE EVER OR YOU WILL BURN!
195
- * ----------------------------------------------------------------
196
- */
197
- /* ----------------
198
- * NOTYET is placed around any code not yet implemented
199
- * in the executor. Only remove these when actually implementing
200
- * said code.
201
- * ----------------
202
- */
203
- #undef NOTYET
204
-
205
- extern long NDirectFileRead ;
206
- extern long NDirectFileWrite ;
207
-
208
193
#endif /* ExecDebugIncluded */
Original file line number Diff line number Diff line change 8
8
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
9
9
* Portions Copyright (c) 1994, Regents of the University of California
10
10
*
11
- * $PostgreSQL: pgsql/src/include/storage/buf_internals.h,v 1.98 2008/08/11 11:05:11 heikki Exp $
11
+ * $PostgreSQL: pgsql/src/include/storage/buf_internals.h,v 1.99 2008/09/17 13:15:55 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -180,6 +180,8 @@ extern long int BufferHitCount;
180
180
extern long int LocalBufferHitCount ;
181
181
extern long int BufferFlushCount ;
182
182
extern long int LocalBufferFlushCount ;
183
+ extern long int BufFileReadCount ;
184
+ extern long int BufFileWriteCount ;
183
185
184
186
185
187
/*
You can’t perform that action at this time.
0 commit comments