In spirit of incremental improvement, here is a trivial fix to use %p
instead %d to print pointer. -- maybe we should use context name better.
Regards,
Qingqing
? printf_patch.diff
Index: nodeAppend.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/executor/nodeAppend.c,v
retrieving revision 1.68
diff -c -r1.68 nodeAppend.c
*** nodeAppend.c 5 Mar 2006 15:58:26 -0000 1.68
--- nodeAppend.c 23 May 2006 08:27:37 -0000
***************
*** 151,157 ****
/* check for unsupported flags */
Assert(!(eflags & EXEC_FLAG_MARK));
! CXT1_printf("ExecInitAppend: context is %d\n", CurrentMemoryContext);
/*
* Set up empty vector of subplan states
--- 151,157 ----
/* check for unsupported flags */
Assert(!(eflags & EXEC_FLAG_MARK));
! CXT1_printf("ExecInitAppend: context is %p\n", CurrentMemoryContext);
/*
* Set up empty vector of subplan states
Index: nodeBitmapAnd.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/executor/nodeBitmapAnd.c,v
retrieving revision 1.6
diff -c -r1.6 nodeBitmapAnd.c
*** nodeBitmapAnd.c 5 Mar 2006 15:58:26 -0000 1.6
--- nodeBitmapAnd.c 23 May 2006 08:27:37 -0000
***************
*** 52,58 ****
/* check for unsupported flags */
Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
! CXT1_printf("ExecInitBitmapAnd: context is %d\n", CurrentMemoryContext);
/*
* Set up empty vector of subplan states
--- 52,58 ----
/* check for unsupported flags */
Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
! CXT1_printf("ExecInitBitmapAnd: context is %p\n", CurrentMemoryContext);
/*
* Set up empty vector of subplan states
Index: nodeBitmapHeapscan.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/executor/nodeBitmapHeapscan.c,v
retrieving revision 1.10
diff -c -r1.10 nodeBitmapHeapscan.c
*** nodeBitmapHeapscan.c 5 Mar 2006 15:58:26 -0000 1.10
--- nodeBitmapHeapscan.c 23 May 2006 08:27:38 -0000
***************
*** 511,517 ****
ExecInitResultTupleSlot(estate, &scanstate->ss.ps);
ExecInitScanTupleSlot(estate, &scanstate->ss);
! CXT1_printf("ExecInitBitmapHeapScan: context is %d\n",
CurrentMemoryContext);
/*
* open the base relation and acquire appropriate lock on it.
--- 511,517 ----
ExecInitResultTupleSlot(estate, &scanstate->ss.ps);
ExecInitScanTupleSlot(estate, &scanstate->ss);
! CXT1_printf("ExecInitBitmapHeapScan: context is %p\n",
CurrentMemoryContext);
/*
* open the base relation and acquire appropriate lock on it.
Index: nodeBitmapIndexscan.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/executor/nodeBitmapIndexscan.c,v
retrieving revision 1.17
diff -c -r1.17 nodeBitmapIndexscan.c
*** nodeBitmapIndexscan.c 5 Mar 2006 15:58:26 -0000 1.17
--- nodeBitmapIndexscan.c 23 May 2006 08:27:38 -0000
***************
*** 266,272 ****
*/
indexstate->biss_RuntimeKeysReady = false;
! CXT1_printf("ExecInitBitmapIndexScan: context is %d\n",
CurrentMemoryContext);
/*
* build the index scan keys from the index qualification
--- 266,272 ----
*/
indexstate->biss_RuntimeKeysReady = false;
! CXT1_printf("ExecInitBitmapIndexScan: context is %p\n",
CurrentMemoryContext);
/*
* build the index scan keys from the index qualification
Index: nodeBitmapOr.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/executor/nodeBitmapOr.c,v
retrieving revision 1.5
diff -c -r1.5 nodeBitmapOr.c
*** nodeBitmapOr.c 5 Mar 2006 15:58:26 -0000 1.5
--- nodeBitmapOr.c 23 May 2006 08:27:39 -0000
***************
*** 53,59 ****
/* check for unsupported flags */
Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
! CXT1_printf("ExecInitBitmapOr: context is %d\n", CurrentMemoryContext);
/*
* Set up empty vector of subplan states
--- 53,59 ----
/* check for unsupported flags */
Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
! CXT1_printf("ExecInitBitmapOr: context is %p\n", CurrentMemoryContext);
/*
* Set up empty vector of subplan states
Index: nodeIndexscan.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v
retrieving revision 1.112
diff -c -r1.112 nodeIndexscan.c
*** nodeIndexscan.c 5 Mar 2006 15:58:26 -0000 1.112
--- nodeIndexscan.c 23 May 2006 08:27:44 -0000
***************
*** 528,534 ****
*/
indexstate->iss_RuntimeKeysReady = false;
! CXT1_printf("ExecInitIndexScan: context is %d\n", CurrentMemoryContext);
/*
* build the index scan keys from the index qualification
--- 528,534 ----
*/
indexstate->iss_RuntimeKeysReady = false;
! CXT1_printf("ExecInitIndexScan: context is %p\n", CurrentMemoryContext);
/*
* build the index scan keys from the index qualification
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match