mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +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/parser/parse_clause.c,v 1.139 2005/04/06 16:34:06 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.140 2005/04/13 16:50:55 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -144,7 +144,8 @@ setTargetTable(ParseState *pstate, RangeVar *relation,
|
||||
/*
|
||||
* Now build an RTE.
|
||||
*/
|
||||
rte = addRangeTableEntry(pstate, relation, NULL, inh, false);
|
||||
rte = addRangeTableEntryForRelation(pstate, pstate->p_target_relation,
|
||||
NULL, inh, false);
|
||||
pstate->p_target_rangetblentry = rte;
|
||||
|
||||
/* assume new rte is at end */
|
||||
|
Reference in New Issue
Block a user