Thread: How to tell if SQL function gets inlined?

How to tell if SQL function gets inlined?

From
Joe Conway
Date:
Is there any way, short of using a debugger with a strategically placed 
breakpoint, to tell if a SQL function has been inlined?

Joe



Re: How to tell if SQL function gets inlined?

From
Bruce Momjian
Date:
Joe Conway wrote:
> Is there any way, short of using a debugger with a strategically placed 
> breakpoint, to tell if a SQL function has been inlined?

I think you will only see it with debug_print_plan enabled.  You can
change client_min_messages to see that in your psql session.  I think
the parse tree doesn't do the inlining, only the optimizer.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


Re: How to tell if SQL function gets inlined?

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Joe Conway wrote:
>> Is there any way, short of using a debugger with a strategically placed 
>> breakpoint, to tell if a SQL function has been inlined?

> I think you will only see it with debug_print_plan enabled.

If the function is in the WHERE clause then you can see it in EXPLAIN
output.  Functions in the SELECT list you can't see without wading
through EXPLAIN VERBOSE (or equivalently debug_print_plan).
        regards, tom lane