How to tell if SQL function gets inlined?

Started by Joe Conwayabout 22 years ago3 messages
#1Joe Conway
mail@joeconway.com

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

Joe

#2Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Joe Conway (#1)
Re: How to tell if SQL function gets inlined?

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, Pennsylvania 19073
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#2)
Re: How to tell if SQL function gets inlined?

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