Re: Predicates not getting pushed into SQL function?

From: Jay Levitt <jay(dot)levitt(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Predicates not getting pushed into SQL function?
Date: 2011-11-07 20:13:43
Message-ID: 4EB83BF7.4070905@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tom Lane wrote:
> Please don't send HTML-only email to these lists.

Oops - new mail client, sorry.

> Anyway, the answer seems to be that inline_set_returning_function needs
> some work to handle cases with declared OUT parameters. I will see
> about fixing that going forward, but in existing releases what you need
> to do is declare the function as returning SETOF some named composite
> type

Yes, that patch works great! Oddly enough, the workaround now does NOT
work; functions returning SETOF named composite types don't get inlined, but
functions returning the equivalent TABLE do get inlined. Let me know if you
need a failcase, but the bug doesn't actually affect me now :)

Jay

>
> create type matcher_result as (user_id int, match int);
>
> create or replace function matcher() returns setof matcher_result as ...

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jay Levitt 2011-11-07 20:15:23 Re: Predicates not getting pushed into SQL function?
Previous Message Ivan Voras 2011-11-07 15:21:08 Re: PostgreSQL perform poorly on VMware ESXi