1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Simplify ParamListInfo data structure to support only numbered parameters,

not named ones, and replace linear searches of the list with array indexing.
The named-parameter support has been dead code for many years anyway,
and recent profiling suggests that the searching was costing a noticeable
amount of performance for complex queries.
This commit is contained in:
Tom Lane
2006-04-22 01:26:01 +00:00
parent 0606860a20
commit 2206b498d8
20 changed files with 214 additions and 335 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.191 2006/03/14 22:48:21 tgl Exp $
* $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.192 2006/04/22 01:26:00 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -568,8 +568,8 @@ transformParamRef(ParseState *pstate, ParamRef *pref)
}
param = makeNode(Param);
param->paramkind = PARAM_NUM;
param->paramid = (AttrNumber) paramno;
param->paramkind = PARAM_EXTERN;
param->paramid = paramno;
param->paramtype = toppstate->p_paramtypes[paramno - 1];
return (Node *) param;
@ -1177,7 +1177,7 @@ transformSubLink(ParseState *pstate, SubLink *sublink)
param = makeNode(Param);
param->paramkind = PARAM_SUBLINK;
param->paramid = (AttrNumber) tent->resno;
param->paramid = tent->resno;
param->paramtype = exprType((Node *) tent->expr);
right_list = lappend(right_list, param);