From 2fdf9e0be6b474e38e516007b5ac5274ecef514d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 13 Apr 2005 16:50:55 +0000 Subject: 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. --- src/backend/commands/tablecmds.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/commands/tablecmds.c') diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 21655e7d61..79e36c64e7 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -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); -- cgit v1.2.1