On Sun, 2005-04-24 at 02:28 -0400, Tom Lane wrote:
> In the current code there is no such thing as a hard read-only behavior
> --- for example we will try to update commit-status hint bits no matter
> what.  Allowing that to be turned off would be interesting for a number
> of purposes, such as burning a database onto CD.

Short patch enclosed to turn off writing of commit-status hint bits.

I've called this "cache_txn_status_with_data" but I'm open to other
suggestions...

This should allow migration of older child tables to hierarchical
storage when using a large historical table design.

Best Regards, Simon Riggs
Index: src/backend/storage/buffer/bufmgr.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v
retrieving revision 1.189
diff -c -c -r1.189 bufmgr.c
*** src/backend/storage/buffer/bufmgr.c	19 May 2005 21:35:46 -0000	1.189
--- src/backend/storage/buffer/bufmgr.c	19 Jul 2005 22:50:25 -0000
***************
*** 63,68 ****
--- 63,69 ----
  
  /* GUC variables */
  bool		zero_damaged_pages = false;
+ bool        cache_txn_status_with_data = true;
  double		bgwriter_lru_percent = 1.0;
  double		bgwriter_all_percent = 0.333;
  int			bgwriter_lru_maxpages = 5;
***************
*** 1638,1643 ****
--- 1639,1647 ----
  		return;
  	}
  
+     if (!cache_txn_status_with_data)
+         return;
+ 
  	bufHdr = &BufferDescriptors[buffer - 1];
  
  	Assert(PrivateRefCount[buffer - 1] > 0);
Index: src/backend/utils/misc/guc.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/utils/misc/guc.c,v
retrieving revision 1.274
diff -c -c -r1.274 guc.c
*** src/backend/utils/misc/guc.c	14 Jul 2005 05:13:42 -0000	1.274
--- src/backend/utils/misc/guc.c	19 Jul 2005 22:50:34 -0000
***************
*** 487,492 ****
--- 487,502 ----
  		false, NULL, NULL
  	},
  	{
+ 		{"cache_txn_status_with_data", PGC_USERSET, DEVELOPER_OPTIONS,
+ 			gettext_noop("Writes transaction status to each row."),
+ 			gettext_noop("PostgreSQL normally avoids commit log accesses by cacheing"
+ 			             "transaction status though this may not be efficient with write-once,"
+                          " then read-only access.")
+ 		},
+ 		&cache_txn_status_with_data,
+ 		true, NULL, NULL
+ 	},
+ 	{
  		{"full_page_writes", PGC_SIGHUP, WAL_SETTINGS,
  			gettext_noop("Writes full pages to WAL when first modified after a checkpoint."),
  			gettext_noop("A page write in process during an operating system crash might be "
Index: src/include/storage/bufmgr.h
===================================================================
RCS file: /projects/cvsroot/pgsql/src/include/storage/bufmgr.h,v
retrieving revision 1.93
diff -c -c -r1.93 bufmgr.h
*** src/include/storage/bufmgr.h	20 Mar 2005 22:00:54 -0000	1.93
--- src/include/storage/bufmgr.h	19 Jul 2005 22:50:46 -0000
***************
*** 27,32 ****
--- 27,33 ----
  
  /* in bufmgr.c */
  extern bool zero_damaged_pages;
+ extern bool cache_txn_status_with_data;
  extern double bgwriter_lru_percent;
  extern double bgwriter_all_percent;
  extern int	bgwriter_lru_maxpages;
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to