Re: Patch for removng unused targets

Поиск
Список
Период
Сортировка
От Hitoshi Harada
Тема Re: Patch for removng unused targets
Дата
Msg-id CAP7QgmnETeD3QtPh82uwfUy0Wh1wiZbF-X7OrrBfTfvWVe3b-Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Patch for removng unused targets  ("Etsuro Fujita" <fujita.etsuro@lab.ntt.co.jp>)
Ответы Re: Patch for removng unused targets  ("Etsuro Fujita" <fujita.etsuro@lab.ntt.co.jp>)
Список pgsql-hackers



On Wed, Jun 19, 2013 at 4:49 AM, Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp> wrote:

Hi Harada-san,

 

Thank you for the review.

 

I think that the parse tree has enough information to do this optimization and that the easiest way to do it is to use the information, though I might not have understand your comments correctly.  So, I would like to fix the bug by simply modifying the removability check in adjust_targetlist() so that the resjunk column is not used in GROUP BY, DISTINCT ON and *window PARTITION/ORDER BY*, besides ORDER BY.  No?  I am open to any comments.

 


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.  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.

Thanks,
--
Hitoshi Harada

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Bugfix and new feature for PGXS
Следующее
От: Cédric Villemain
Дата:
Сообщение: Re: Bugfix and new feature for PGXS