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

pgsql: Fix set_rel_width() to do something reasonable with non-Var items

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix set_rel_width() to do something reasonable with non-Var items
Date: 2009-07-11 04:09:33
Message-ID: 20090711040933.7A08375331E@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Fix set_rel_width() to do something reasonable with non-Var items in a
RelOptInfo targetlist.  It used to be that the only possibility other than
a Var was a RowExpr representing a whole-row child Var, but as of 8.4's
expanded ability to flatten appendrel members, we can get arbitrary expressions
in there.  Use the expression's type info and get_typavgwidth() to produce
an at-least-marginally-sane result.  Note that get_typavgwidth()'s fallback
estimate (32 bytes) is the same as what was here before, so there will be
no behavioral change for RowExprs.  Noted while looking at recent gripe
about constant quals pushed down to FunctionScan appendrel members ...
not only were we failing to recognize the constant qual, we were getting
the width estimate wrong :-(

Modified Files:
--------------
    pgsql/src/backend/optimizer/path:
        costsize.c (r1.209 -> r1.210)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/costsize.c?r1=1.209&r2=1.210)

pgsql-committers by date

Next:From: Tom LaneDate: 2009-07-11 04:09:40
Subject: pgsql: Fix set_rel_width() to do something reasonable with non-Var items
Previous:From: User BloodnokDate: 2009-07-10 22:40:21
Subject: veil - veil: Minor documentation fix

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