Re: Identifying no-op length coercions

From: Noah Misch <noah(at)leadboat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com>, Alexey Klyukin <alexk(at)commandprompt(dot)com>
Subject: Re: Identifying no-op length coercions
Date: 2011-06-11 21:13:04
Message-ID: 20110611211304.GB21098@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jun 11, 2011 at 03:03:18PM -0400, Tom Lane wrote:
> Noah Misch <noah(at)leadboat(dot)com> writes:
> > Good points. I'm thinking, then, add an Expr argument to simplify_function()
> > and have the CoerceViaIO branch of eval_const_expressions_mutator() pass NULL
> > for both its simplify_function() calls. If simplify_function() gets a NULL Expr
> > for a function that has a protransform, synthesize a FuncExpr based on its other
> > arguments before calling the transform function. Seem reasonable? Granted,
> > that would be dead code until someone applies a transform function to a type I/O
> > function, which could easily never happen. Perhaps just ignore the transform
> > function when we started with a CoerceViaIO node?
>
> Until we actually have a use-case for simplifying I/O functions like this,
> I can't see going out of our way for it ...

Sounds good. Updated patch attached, incorporating your ideas. Before applying
it, run this command to update the uninvolved pg_proc.h DATA entries:
perl -pi -e 's/PGUID(\s+\d+){4}/$& 0/' src/include/catalog/pg_proc.h

Thanks,
nm

Attachment Content-Type Size
noop-length-coercion-v2.patch text/plain 19.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2011-06-11 21:43:14 Re: deadlock_timeout at < PGC_SIGHUP?
Previous Message Bruce Momjian 2011-06-11 20:23:24 Re: procpid?