From: | tgl(at)svr1(dot)postgresql(dot)org (Tom Lane) |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Fix up LIMIT/OFFSET planning so that we cope with non-constant |
Date: | 2005-08-18 17:51:13 |
Message-ID: | 20050818175113.EDE9A52BE6@svr1.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Log Message:
-----------
Fix up LIMIT/OFFSET planning so that we cope with non-constant LIMIT
or OFFSET clauses by using estimate_expression_value(). The main advantage
of this is that if the expression is a Param and we have a value for the
Param, we'll use that value rather than defaulting. Also, fix some
thinkos in the logic for combining LIMIT/OFFSET with an externally
supplied tuple fraction (this covers cases like EXISTS(...LIMIT...)).
And make sure the results of all this are shown by EXPLAIN. Per a
gripe from Merlin Moncure.
Modified Files:
--------------
pgsql/src/backend/optimizer/plan:
createplan.c (r1.196 -> r1.197)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/createplan.c.diff?r1=1.196&r2=1.197)
planagg.c (r1.7 -> r1.8)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planagg.c.diff?r1=1.7&r2=1.8)
planner.c (r1.190 -> r1.191)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planner.c.diff?r1=1.190&r2=1.191)
pgsql/src/include/optimizer:
planmain.h (r1.86 -> r1.87)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/planmain.h.diff?r1=1.86&r2=1.87)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2005-08-18 21:34:21 | pgsql: Update some obsolete comments --- code is using t_self now, not |
Previous Message | Bruce Momjian | 2005-08-18 14:14:32 | pgsql: Add: > o Remove unnecessary abstractions in pg_dump source code |