Hi,

I found the unused argument "vac_delay" in ginInsertCleanup().
I think that we should remove it. Patch attached.

Regards,

-- 
Fujii Masao
*** a/src/backend/access/gin/ginfast.c
--- b/src/backend/access/gin/ginfast.c
***************
*** 434,440 **** ginHeapTupleFastInsert(GinState *ginstate, GinTupleCollector *collector)
  	END_CRIT_SECTION();
  
  	if (needCleanup)
! 		ginInsertCleanup(ginstate, false, true, NULL);
  }
  
  /*
--- 434,440 ----
  	END_CRIT_SECTION();
  
  	if (needCleanup)
! 		ginInsertCleanup(ginstate, true, NULL);
  }
  
  /*
***************
*** 732,740 **** processPendingPage(BuildAccumulator *accum, KeyArray *ka,
   * action of removing a page from the pending list really needs exclusive
   * lock.
   *
-  * vac_delay indicates that ginInsertCleanup should call
-  * vacuum_delay_point() periodically.
-  *
   * fill_fsm indicates that ginInsertCleanup should add deleted pages
   * to FSM otherwise caller is responsible to put deleted pages into
   * FSM.
--- 732,737 ----
***************
*** 743,750 **** processPendingPage(BuildAccumulator *accum, KeyArray *ka,
   */
  void
  ginInsertCleanup(GinState *ginstate,
! 				 bool vac_delay, bool fill_fsm,
! 				 IndexBulkDeleteResult *stats)
  {
  	Relation	index = ginstate->index;
  	Buffer		metabuffer,
--- 740,746 ----
   */
  void
  ginInsertCleanup(GinState *ginstate,
! 				 bool fill_fsm, IndexBulkDeleteResult *stats)
  {
  	Relation	index = ginstate->index;
  	Buffer		metabuffer,
*** a/src/backend/access/gin/ginvacuum.c
--- b/src/backend/access/gin/ginvacuum.c
***************
*** 541,547 **** ginbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
  		/* Yes, so initialize stats to zeroes */
  		stats = (IndexBulkDeleteResult *) palloc0(sizeof(IndexBulkDeleteResult));
  		/* and cleanup any pending inserts */
! 		ginInsertCleanup(&gvs.ginstate, true, false, stats);
  	}
  
  	/* we'll re-count the tuples each time */
--- 541,547 ----
  		/* Yes, so initialize stats to zeroes */
  		stats = (IndexBulkDeleteResult *) palloc0(sizeof(IndexBulkDeleteResult));
  		/* and cleanup any pending inserts */
! 		ginInsertCleanup(&gvs.ginstate, false, stats);
  	}
  
  	/* we'll re-count the tuples each time */
***************
*** 654,660 **** ginvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats)
  		if (IsAutoVacuumWorkerProcess())
  		{
  			initGinState(&ginstate, index);
! 			ginInsertCleanup(&ginstate, true, true, stats);
  		}
  		return stats;
  	}
--- 654,660 ----
  		if (IsAutoVacuumWorkerProcess())
  		{
  			initGinState(&ginstate, index);
! 			ginInsertCleanup(&ginstate, true, stats);
  		}
  		return stats;
  	}
***************
*** 667,673 **** ginvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats)
  	{
  		stats = (IndexBulkDeleteResult *) palloc0(sizeof(IndexBulkDeleteResult));
  		initGinState(&ginstate, index);
! 		ginInsertCleanup(&ginstate, true, false, stats);
  	}
  
  	memset(&idxStat, 0, sizeof(idxStat));
--- 667,673 ----
  	{
  		stats = (IndexBulkDeleteResult *) palloc0(sizeof(IndexBulkDeleteResult));
  		initGinState(&ginstate, index);
! 		ginInsertCleanup(&ginstate, false, stats);
  	}
  
  	memset(&idxStat, 0, sizeof(idxStat));
*** a/src/include/access/gin_private.h
--- b/src/include/access/gin_private.h
***************
*** 946,952 **** extern void ginHeapTupleFastCollect(GinState *ginstate,
  						OffsetNumber attnum, Datum value, bool isNull,
  						ItemPointer ht_ctid);
  extern void ginInsertCleanup(GinState *ginstate,
! 				 bool vac_delay, bool fill_fsm, IndexBulkDeleteResult *stats);
  
  /* ginpostinglist.c */
  
--- 946,952 ----
  						OffsetNumber attnum, Datum value, bool isNull,
  						ItemPointer ht_ctid);
  extern void ginInsertCleanup(GinState *ginstate,
! 				 bool fill_fsm, IndexBulkDeleteResult *stats);
  
  /* ginpostinglist.c */
  
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to