Re: Patch for removng unused targets

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch for removng unused targets
Date: 2012-12-04 19:28:18
Message-ID: CAPpHfdsv8z89=PnqvRkGztDzrY0O_DOh2QqRumZ1ewwtW7-f9g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 3, 2012 at 8:31 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> "Etsuro Fujita" <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> writes:
> > Sorry for the delay. I've reviewed the patch. It was applied
> > successfully, and it worked well for tests I did including the example
> > you showed. I think it's worth the work, but I'm not sure you go
> > about it in the right way. (I feel the patch decreases code
> > readability more than it gives an advantage.)
>
> One thought here is that I don't particularly like adding a field like
> "resorderbyonly" to TargetEntry in the first place. That makes this
> optimization the business of the parser, which it should not be; and
> furthermore makes it incumbent on the rewriter, as well as anything else
> that manipulates parsetrees, to maintain the flag correctly while
> rearranging queries. It would be better if this were strictly the
> business of the planner.
>
> But having said that, I'm wondering (without having read the patch)
> why you need anything more than the existing "resjunk" field.
>

Actually, I don't know all the cases when "resjunk" flag is set. Is it
reliable to decide target to be used only for "ORDER BY" if it's "resjunk"
and neither system or used in grouping? If it's so or there are some other
cases which are easy to determine then I'll remove "resorderbyonly" flag.

------
With best regards,
Alexander Korotkov.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2012-12-04 19:30:21 Re: WIP: store additional info in GIN index
Previous Message Alexander Korotkov 2012-12-04 19:12:11 Re: WIP: store additional info in GIN index