mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +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:
@@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.332 2006/03/23 00:19:29 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.333 2006/04/22 01:25:59 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3205,7 +3205,7 @@ check_parameter_resolution_walker(Node *node,
|
||||
{
|
||||
Param *param = (Param *) node;
|
||||
|
||||
if (param->paramkind == PARAM_NUM)
|
||||
if (param->paramkind == PARAM_EXTERN)
|
||||
{
|
||||
int paramno = param->paramid;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.137 2006/04/05 22:11:55 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.138 2006/04/22 01:25:59 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -210,7 +210,7 @@ coerce_type(ParseState *pstate, Node *node,
|
||||
return result;
|
||||
}
|
||||
if (inputTypeId == UNKNOWNOID && IsA(node, Param) &&
|
||||
((Param *) node)->paramkind == PARAM_NUM &&
|
||||
((Param *) node)->paramkind == PARAM_EXTERN &&
|
||||
pstate != NULL && pstate->p_variableparams)
|
||||
{
|
||||
/*
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user