Re: Inlining of functions (doing LIKE on an array)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "ldh(at)laurent-hasson(dot)com" <ldh(at)laurent-hasson(dot)com>
Cc: Marc Mamin <M(dot)Mamin(at)intershop(dot)de>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Inlining of functions (doing LIKE on an array)
Date: 2016-11-12 19:59:32
Message-ID: 2795.1478980772@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"ldh(at)laurent-hasson(dot)com" <ldh(at)laurent-hasson(dot)com> writes:
> I wish there were a way to force inlining, or some other mechanism as the performance difference is large here. I'll be using the inlining approach when possible, but the SQL Function approach is simpler and will likely be more suitable for some developers.

I'm not sure that there's any fundamental reason why we don't inline SQL
functions containing sub-selects. It may just be not having wanted to put
any effort into the case way-back-when. Inlining happens too late to
allow a resulting WHERE EXISTS to get mutated into a semijoin, but in this
example that couldn't happen anyway, so it's not much of an objection.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message ldh@laurent-hasson.com 2016-11-12 20:17:08 Re: Inlining of functions (doing LIKE on an array)
Previous Message Jeff Janes 2016-11-12 19:25:34 Re: Any advice tuning this query ?