File tree Expand file tree Collapse file tree 5 files changed +17
-29
lines changed Expand file tree Collapse file tree 5 files changed +17
-29
lines changed Original file line number Diff line number Diff line change 88 *
99 *
1010 * 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 $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -29,6 +29,8 @@ long int BufferHitCount;
2929long int LocalBufferHitCount ;
3030long int BufferFlushCount ;
3131long int LocalBufferFlushCount ;
32+ long int BufFileReadCount ;
33+ long int BufFileWriteCount ;
3234
3335
3436/*
Original file line number Diff line number Diff line change 88 *
99 *
1010 * 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 $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -64,12 +64,6 @@ bool zero_damaged_pages = false;
6464int bgwriter_lru_maxpages = 100 ;
6565double bgwriter_lru_multiplier = 2.0 ;
6666
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-
7367/* local state for StartBufferIO and related functions */
7468static volatile BufferDesc * InProgressBuf = NULL ;
7569static bool IsForInput ;
@@ -1572,7 +1566,7 @@ ShowBufferUsage(void)
15721566 ReadLocalBufferCount - LocalBufferHitCount , LocalBufferFlushCount , localhitrate );
15731567 appendStringInfo (& str ,
15741568 "!\tDirect blocks: %10ld read, %10ld written\n" ,
1575- NDirectFileRead , NDirectFileWrite );
1569+ BufFileReadCount , BufFileWriteCount );
15761570
15771571 return str .data ;
15781572}
@@ -1586,8 +1580,8 @@ ResetBufferUsage(void)
15861580 LocalBufferHitCount = 0 ;
15871581 ReadLocalBufferCount = 0 ;
15881582 LocalBufferFlushCount = 0 ;
1589- NDirectFileRead = 0 ;
1590- NDirectFileWrite = 0 ;
1583+ BufFileReadCount = 0 ;
1584+ BufFileWriteCount = 0 ;
15911585}
15921586
15931587/*
Original file line number Diff line number Diff line change 77 * Portions Copyright (c) 1994, Regents of the University of California
88 *
99 * 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 $
1111 *
1212 * NOTES:
1313 *
3636
3737#include "storage/fd.h"
3838#include "storage/buffile.h"
39+ #include "storage/buf_internals.h"
3940
4041/*
4142 * We break BufFiles into gigabyte-sized segments, regardless of RELSEG_SIZE.
@@ -238,6 +239,8 @@ BufFileLoadBuffer(BufFile *file)
238239 file -> nbytes = 0 ;
239240 file -> offsets [file -> curFile ] += file -> nbytes ;
240241 /* we choose not to advance curOffset here */
242+
243+ BufFileReadCount ++ ;
241244}
242245
243246/*
@@ -300,6 +303,8 @@ BufFileDumpBuffer(BufFile *file)
300303 file -> offsets [file -> curFile ] += bytestowrite ;
301304 file -> curOffset += bytestowrite ;
302305 wpos += bytestowrite ;
306+
307+ BufFileWriteCount ++ ;
303308 }
304309 file -> dirty = false;
305310
Original file line number Diff line number Diff line change 1010 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
1111 * Portions Copyright (c) 1994, Regents of the University of California
1212 *
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 $
1414 *
1515 *-------------------------------------------------------------------------
1616 */
@@ -190,19 +190,4 @@ extern int NIndexTupleInserted;
190190#define MJ_DEBUG_PROC_NODE (slot )
191191#endif /* EXEC_MERGEJOINDEBUG */
192192
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-
208193#endif /* ExecDebugIncluded */
Original file line number Diff line number Diff line change 88 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
99 * Portions Copyright (c) 1994, Regents of the University of California
1010 *
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 $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -180,6 +180,8 @@ extern long int BufferHitCount;
180180extern long int LocalBufferHitCount ;
181181extern long int BufferFlushCount ;
182182extern long int LocalBufferFlushCount ;
183+ extern long int BufFileReadCount ;
184+ extern long int BufFileWriteCount ;
183185
184186
185187/*
You can’t perform that action at this time.
0 commit comments