From 2206b498d8240447a9353ce4e994ba41a8e307ac Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 22 Apr 2006 01:26:01 +0000 Subject: 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. --- src/backend/utils/adt/ruleutils.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'src/backend/utils/adt/ruleutils.c') diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 902af40d9fc..c0db64bf896 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -2,7 +2,7 @@ * ruleutils.c - Functions to convert stored expressions/querytrees * back to source text * - * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.219 2006/04/08 18:49:52 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.220 2006/04/22 01:26:00 tgl Exp $ **********************************************************************/ #include "postgres.h" @@ -3120,24 +3120,7 @@ get_rule_expr(Node *node, deparse_context *context, break; case T_Param: - { - Param *param = (Param *) node; - - switch (param->paramkind) - { - case PARAM_NAMED: - appendStringInfo(buf, "$%s", param->paramname); - break; - case PARAM_NUM: - case PARAM_EXEC: - case PARAM_SUBLINK: - appendStringInfo(buf, "$%d", param->paramid); - break; - default: - appendStringInfo(buf, "(param)"); - break; - } - } + appendStringInfo(buf, "$%d", ((Param *) node)->paramid); break; case T_Aggref: -- cgit v1.2.3