Re: [HACKERS] remove useless set of active snap

2010-02-22 Thread Alvaro Herrera
Bruce Momjian wrote:
> Alvaro Herrera wrote:
> > This patch removes a useless pushing of an active snapshot on
> > PortalStart.  Instead of push/get/pop of the active snapshot, without
> > any intervening use of the active snapshot, we just pass a local
> > snapshot down to CreateQueryDesc.
> 
> Alvaro, what happened to this patch?

I dropped it because pushing the active snap is no so much a no-op
anymore (it creates a new copy), so the semantics could change.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] remove useless set of active snap

2010-02-22 Thread Bruce Momjian
Alvaro Herrera wrote:
> This patch removes a useless pushing of an active snapshot on
> PortalStart.  Instead of push/get/pop of the active snapshot, without
> any intervening use of the active snapshot, we just pass a local
> snapshot down to CreateQueryDesc.

Alvaro, what happened to this patch?

-- 
  Bruce Momjian  http://momjian.us
  EnterpriseDB http://enterprisedb.com
  PG East:  http://www.enterprisedb.com/community/nav-pg-east-2010.do
  + If your life is a hard drive, Christ can be your backup. +

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] remove useless set of active snap

2009-10-02 Thread Alvaro Herrera
This patch removes a useless pushing of an active snapshot on
PortalStart.  Instead of push/get/pop of the active snapshot, without
any intervening use of the active snapshot, we just pass a local
snapshot down to CreateQueryDesc.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
Index: src/backend/tcop/pquery.c
===
RCS file: /home/alvherre/Code/cvs/pgsql/src/backend/tcop/pquery.c,v
retrieving revision 1.131
diff -c -p -r1.131 pquery.c
*** src/backend/tcop/pquery.c	11 Jun 2009 14:49:02 -	1.131
--- src/backend/tcop/pquery.c	2 Oct 2009 18:11:32 -
*** PortalStart(Portal portal, ParamListInfo
*** 466,471 
--- 466,472 
  	MemoryContext oldContext;
  	QueryDesc  *queryDesc;
  	int			eflags;
+ 	Snapshot	mysnap;
  
  	AssertArg(PortalIsValid(portal));
  	AssertState(portal->status == PORTAL_DEFINED);
*** PortalStart(Portal portal, ParamListInfo
*** 499,509 
  		{
  			case PORTAL_ONE_SELECT:
  
! /* Must set snapshot before starting executor. */
! if (snapshot)
! 	PushActiveSnapshot(snapshot);
! else
! 	PushActiveSnapshot(GetTransactionSnapshot());
  
  /*
   * Create QueryDesc in portal's context; for the moment, set
--- 500,506 
  		{
  			case PORTAL_ONE_SELECT:
  
! mysnap = snapshot ? snapshot : GetTransactionSnapshot();
  
  /*
   * Create QueryDesc in portal's context; for the moment, set
*** PortalStart(Portal portal, ParamListInfo
*** 511,517 
   */
  queryDesc = CreateQueryDesc((PlannedStmt *) linitial(portal->stmts),
  			portal->sourceText,
! 			GetActiveSnapshot(),
  			InvalidSnapshot,
  			None_Receiver,
  			params,
--- 508,514 
   */
  queryDesc = CreateQueryDesc((PlannedStmt *) linitial(portal->stmts),
  			portal->sourceText,
! 			mysnap,
  			InvalidSnapshot,
  			None_Receiver,
  			params,
*** PortalStart(Portal portal, ParamListInfo
*** 556,562 
  portal->portalPos = 0;
  portal->posOverflow = false;
  
- PopActiveSnapshot();
  break;
  
  			case PORTAL_ONE_RETURNING:
--- 553,558 

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers