Re: Suppressing unused subquery output columns - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Suppressing unused subquery output columns
Date
Msg-id CA+TgmoaY+PLWNM-TQnP6uzJUJhhBL8vGeeiqftbo=pHgTXf3ww@mail.gmail.com
Whole thread Raw
In response to Suppressing unused subquery output columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Suppressing unused subquery output columns  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Jun 5, 2014 at 10:27 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> The attached draft patch fixes this by deleting unused output expressions
> from unflattened subqueries, so that we get:
>
> regression=# explain select f1 from (select * from t1 left join t2 on f1=f2 limit 1) ss;
>                             QUERY PLAN
> ------------------------------------------------------------------
>  Subquery Scan on ss  (cost=0.00..0.02 rows=1 width=4)
>    ->  Limit  (cost=0.00..0.01 rows=1 width=4)
>          ->  Seq Scan on t1  (cost=0.00..34.00 rows=2400 width=4)
>  Planning time: 0.193 ms
> (4 rows)
>
> I'm not entirely convinced that it's worth the extra planning cycles,
> though.  Given the small number of complaints to date, it might not
> be worth doing this.  Thoughts?

I've encountered this issue before and think it would be great to fix
it.  I'm not sure precisely how many cycles it's worth paying, but
definitely more than zero.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: lo_create(oid, bytea) breaks every extant release of libpq
Next
From: Pavel Stehule
Date:
Subject: Re: lo_create(oid, bytea) breaks every extant release of libpq