Re: Patch for removng unused targets

From: "Etsuro Fujita" <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: "'Hitoshi Harada'" <umi(dot)tanuki(at)gmail(dot)com>
Cc: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "'Alexander Korotkov'" <aekorotkov(at)gmail(dot)com>, "'pgsql-hackers'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch for removng unused targets
Date: 2013-06-20 07:19:42
Message-ID: 00a701ce6d86$88ae4290$9a0ac7b0$@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> From: Hitoshi Harada [mailto:umi(dot)tanuki(at)gmail(dot)com]

> I guess the patch works fine, but what I'm saying is it might be limited to
> small use cases. Another instance of this that I can think of is ORDER BY
clause
> of window specifications, which you may want to remove from the target list
> as well, in addition to ORDER BY of query. It will just not be removed by
this
> approach, simply because it is looking at only parse->sortClause. Certainly
> you can add more rules to the new function to look at the window
specification,
> but then I'm not sure what we are missing.

Yeah, I thought the extension to the window ORDER BY case, too. But I'm not
sure it's worth complicating the code, considering that the objective of this
optimization is to improve full-text search related things if I understand
correctly, though general solutions would be desirable as you mentioned.

> So, as it stands it doesn't have
> critical issue, but more generalized approach would be desirable. That said,
> I don't have strong objection to the current patch, and just posting one
thought
> to see if others may have the same opinion.

OK. I'll also wait for others' comments. For review, an updated version of the
patch is attached, which fixed the bug using the approach that directly uses the
clause information in the parse tree.

Thanks,

Best regards,
Etsuro Fujit

Attachment Content-Type Size
unused-targets-20130620.patch application/octet-stream 4.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vik Fearing 2013-06-20 07:37:08 Re: LEFT JOIN LATERAL can remove rows from LHS
Previous Message Thomas Munro 2013-06-20 07:05:27 Re: Re: Adding IEEE 754:2008 decimal floating point and hardware support for it