Chris Browne cbbrowne at lists.slony.info
Fri Jul 27 14:37:35 PDT 2007
Update of /home/cvsd/slony1/slony1-engine/src/backend
In directory main.slony.info:/tmp/cvs-serv21938

Modified Files:
      Tag: REL_1_2_STABLE
	slony1_funcs.v81.sql 
Log Message:
Per Jacques Caron, shift UPDATE to pg_class.hasrelindex to *after* the
TRUNCATE, as, in 8.2+, TRUNCATE resets this column (which was undoing
our change).

Without this change, indexes would get updated during the COPY, with
a pretty enormous performance "hit."



Index: slony1_funcs.v81.sql
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/backend/Attic/slony1_funcs.v81.sql,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** slony1_funcs.v81.sql	8 Feb 2007 22:55:58 -0000	1.1.2.1
--- slony1_funcs.v81.sql	27 Jul 2007 21:37:33 -0000	1.1.2.2
***************
*** 41,44 ****
--- 41,51 ----
  
  	-- ----
+ 	-- Try using truncate to empty the table and fallback to
+ 	-- delete on error.
+ 	-- ----
+ 	execute ''truncate '' || @NAMESPACE at .slon_quote_input(v_tab_fqname);
+ 	raise notice ''truncate of % succeeded'', v_tab_fqname;
+ 
+ 	-- ----
  	-- Setting pg_class.relhasindex to false will cause copy not to
  	-- maintain any indexes. At the end of the copy we will reenable
***************
*** 48,57 ****
  	update pg_class set relhasindex = ''f'' where oid = v_tab_oid;
  
- 	-- ----
- 	-- Try using truncate to empty the table and fallback to
- 	-- delete on error.
- 	-- ----
- 	execute ''truncate '' || @NAMESPACE at .slon_quote_input(v_tab_fqname);
- 	raise notice ''truncate of % succeeded'', v_tab_fqname;
  	return 1;
  	exception when others then
--- 55,58 ----



More information about the Slony1-commit mailing list