mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
Change addRangeTableEntryForRelation() to take a Relation pointer instead
of just a relation OID, thereby not having to open the relation for itself. This actually saves code rather than adding it for most of the existing callers, which had the rel open already. The main point though is to be able to use this rather than plain addRangeTableEntry in setTargetTable, thus saving one relation_openrv/relation_close cycle for every INSERT, UPDATE, or DELETE. Seems to provide a several percent win on simple INSERTs.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.152 2005/03/29 00:16:57 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.153 2005/04/13 16:50:54 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4732,8 +4732,8 @@ ATPrepAlterColumnType(List **wqueue,
|
||||
|
||||
/* Expression must be able to access vars of old table */
|
||||
rte = addRangeTableEntryForRelation(pstate,
|
||||
RelationGetRelid(rel),
|
||||
makeAlias(RelationGetRelationName(rel), NIL),
|
||||
rel,
|
||||
NULL,
|
||||
false,
|
||||
true);
|
||||
addRTEtoQuery(pstate, rte, false, true);
|
||||
|
Reference in New Issue
Block a user