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

2016-11-12 Thread l...@laurent-hasson.com
4:59 To: l...@laurent-hasson.com Cc: Marc Mamin; pgsql-performance@postgresql.org Subject: Re: [PERFORM] Inlining of functions (doing LIKE on an array) "l...@laurent-hasson.com" <l...@laurent-hasson.com> writes: > I wish there were a way to force inlining, or some other me

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

2016-11-12 Thread Tom Lane
"l...@laurent-hasson.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

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

2016-11-11 Thread l...@laurent-hasson.com
-> Function Scan on unnest a (cost=0.00..1.25 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=1936953)" --"Filter: (a ~~ '427%'::text)" --" Rows Removed by Filter: 2" --"Planning time: 0.155 ms" --"Execution time: 28

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

2016-11-11 Thread Jeff Janes
On Thu, Nov 10, 2016 at 10:54 PM, l...@laurent-hasson.com < l...@laurent-hasson.com> wrote: > Hello, > > > > I am trying to implement an efficient “like” over a text[]. I see a lot of > people have tried before me and I learnt a lot through the forums. > Have you looked at parray_gin?

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

2016-11-11 Thread Tom Lane
"l...@laurent-hasson.com" writes: > I tried "exists", but won't work in the Function, i.e., > CREATE OR REPLACE FUNCTION ArrayLike(text[], text) RETURNS bigint > AS 'exists (select * from unnest($1) a where a like $2)' > LANGUAGE SQL STRICT IMMUTABLE LEAKPROOF Syntax

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

2016-11-11 Thread l...@laurent-hasson.com
t Hasson -Original Message- From: Marc Mamin [mailto:m.ma...@intershop.de] Sent: Friday, November 11, 2016 07:44 To: l...@laurent-hasson.com; pgsql-performance@postgresql.org Subject: RE: Inlining of functions (doing LIKE on an array) > From: pgsql-performance-ow...@postgresql.org &g

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

2016-11-11 Thread Marc Mamin
> From: pgsql-performance-ow...@postgresql.org > [mailto:pgsql-performance-ow...@postgresql.org] On Behalf Of > l...@laurent-hasson.com > Sent: Freitag, 11. November 2016 07:54 > To: pgsql-performance@postgresql.org > Subject: [PERFORM] Inlining of functions (doin

[PERFORM] Inlining of functions (doing LIKE on an array)

2016-11-10 Thread l...@laurent-hasson.com
Hello, I am trying to implement an efficient "like" over a text[]. I see a lot of people have tried before me and I learnt a lot through the forums. The results of my search is that a query like the following is optimal: select count(*) from claims where (select count(*) from