Skip site navigation (1) Skip section navigation (2)

pgsql-server: When using extended-query protocol, postpone planning of

From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql-server: When using extended-query protocol, postpone planning of
Date: 2004-06-11 01:09:29
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Log Message:
When using extended-query protocol, postpone planning of unnamed statements
until Bind is received, so that actual parameter values are visible to the
planner.  Make use of the parameter values for estimation purposes (but
don't fold them into the actual plan).  This buys back most of the
potential loss of plan quality that ensues from using out-of-line
parameters instead of putting literal values right into the query text.

This patch creates a notion of constant-folding expressions 'for
estimation purposes only', in which case we can be more aggressive than
the normal eval_const_expressions() logic can be.  Right now the only
difference in behavior is inserting bound values for Params, but it will
be interesting to look at other possibilities.  One that we've seen
come up repeatedly is reducing now() and related functions to current
values, so that queries like ... WHERE timestampcol > now() - '1 day'
have some chance of being planned effectively.

Oliver Jowett, with some kibitzing from Tom Lane.

Modified Files:
        protocol.sgml (r1.51 -> r1.52)
        explain.c (r1.121 -> r1.122)
        portalcmds.c (r1.27 -> r1.28)
        prepare.c (r1.27 -> r1.28)
        functions.c (r1.81 -> r1.82)
        spi.c (r1.117 -> r1.118)
        clausesel.c (r1.67 -> r1.68)
        planner.c (r1.171 -> r1.172)
        clauses.c (r1.175 -> r1.176)
        postgres.c (r1.419 -> r1.420)
        selfuncs.c (r1.160 -> r1.161)
        clauses.h (r1.73 -> r1.74)
        planner.h (r1.28 -> r1.29)
        tcopprot.h (r1.66 -> r1.67)

pgsql-committers by date

Next:From: Christopher Kings-LynneDate: 2004-06-11 01:13:15
Subject: Re: pgsql-server: Fix oversight in recent ALTER TABLE
Previous:From: Bruce MomjianDate: 2004-06-11 00:57:27
Subject: pgsql-server: More restructuring to use Win32 START with paths needing

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group