I think there's a call to pgstat_count_index_scan missing in GIN.
Currently, the idx_scan column of pg_stat_*_indexes is stuck at zero
for GIN indexes.

Patch attached.

Thanks,
andreas
Index: src/backend/access/gin/ginscan.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/access/gin/ginscan.c,v
retrieving revision 1.3
diff -c -r1.3 ginscan.c
*** src/backend/access/gin/ginscan.c	14 Jul 2006 14:52:16 -0000	1.3
--- src/backend/access/gin/ginscan.c	2 Aug 2006 23:07:30 -0000
***************
*** 15,20 ****
--- 15,21 ----
  #include "postgres.h"
  #include "access/genam.h"
  #include "access/gin.h"
+ #include "pgstat.h"
  #include "utils/memutils.h"
  
  
***************
*** 155,160 ****
--- 156,163 ----
  
  	if ( so->nkeys == 0 )
  		elog(ERROR, "Gin doesn't support full scan due to it's awful inefficiency");
+ 
+ 	pgstat_count_index_scan(&scan->xs_pgstat_info);
  }
  
  Datum
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to