Re: Performance problems inside a stored procedure.

Поиск
Список
Период
Сортировка
От Matthew Lunnon
Тема Re: Performance problems inside a stored procedure.
Дата
Msg-id 479DC630.9010707@rwa-net.co.uk
обсуждение исходный текст
Ответ на Re: Performance problems inside a stored procedure.  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Ответы Re: Performance problems inside a stored procedure.  (Euler Taveira de Oliveira <euler@timbira.com>)
Список pgsql-performance
Ahh, sorry, I have been too aggressive with my cutting, I am running
8.2.6 and the function is below.

Thanks.
Matthew

CREATE OR REPLACE FUNCTION sp_get_price_panel_id(int4, "varchar",
"varchar", "varchar", bpchar)
  RETURNS SETOF t_market_price_panel AS
$BODY$
SELECT *
   FROM market mrkt
   JOIN market_group_relation mgr USING (market_id)
   JOIN market_group mg USING (market_group_id)
   JOIN market_group_price_relation mgpr USING (market_group_id)
   JOIN accommodation_price_panel app ON
app.accommodation_price_panel_id = mgpr.price_panel_id
WHERE mrkt.live <> 'X'::bpchar AND mg.live <> 'X'::bpchar AND app.live
<> 'X'::bpchar
    AND MARKET_ID = $1
    AND CODE = $2
    AND CODE_TYPE = $3::CHAR(2)
    AND CONTRACT_ID = $4
    AND ( PRICE_PANEL_TYPE = 'B' OR PRICE_PANEL_TYPE = $5 );
$BODY$
  LANGUAGE 'sql' VOLATILE;


Heikki Linnakangas wrote:
> Matthew Lunnon wrote:
>> I have a query which runs pretty quick ( 0.82ms) but when I put it
>> inside a stored procedure  it takes 10 times as long (11.229ms).  Is
>> this what you would expect and is there any way that I can get around
>> this time delay?
>
> It depends. You'll need to show us the function. Also, what version of
> Postgres are you running?
>

В списке pgsql-performance по дате отправления:

Предыдущее
От: "Heikki Linnakangas"
Дата:
Сообщение: Re: Performance problems inside a stored procedure.
Следующее
От: Dean Rasheed
Дата:
Сообщение: Re: Slow set-returning functions