Re: explain analyze on a function

From: Rikard Pavelic <rikard(dot)pavelic(at)zg(dot)htnet(dot)hr>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: explain analyze on a function
Date: 2007-06-14 17:33:00
Message-ID: 46717BCC.20103@zg.htnet.hr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera wrote:
> Try doing a PREPARE and then EXPLAIN EXECUTE, like
>
> alvherre=# prepare foo as select generate_series(1, $1);
> PREPARE
>
> alvherre=# explain analyze execute foo(100);
> QUERY PLAN
> --------------------------------------------------------------------------------------
> Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.014..0.294 rows=100 loops=1)
> Total runtime: 0.550 ms
> (2 filas)
>
> alvherre=# explain analyze execute foo(10000);
> QUERY PLAN
> -----------------------------------------------------------------------------------------
> Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.012..35.082 rows=10000 loops=1)
> Total runtime: 59.077 ms
> (2 filas)
>
>
>

Hm, no luck ;(

prepare f1 as select * from
raspored.dohvati_statistiku_rada_u_smjenama_radnika($1, $2);
explain analyze execute f1(current_date, 4);

"Function Scan on dohvati_statistiku_rada_u_smjenama_radnika
(cost=0.00..12.50 rows=1000 width=188) (actual time=8013.779..8013.906
rows=75 loops=1)"
"Total runtime: 8014.073 ms"

Regards,
Rikard

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2007-06-14 17:39:50 Re: strange change (and error) in 8.3 ?
Previous Message Alvaro Herrera 2007-06-14 17:17:51 Re: DeadLocks..., DeadLocks...