Subject Re: [firebird-support] how to measure stored procedure performance
Author Hans
This work for me, using one user/connection:

CREATE PROCEDURE ACURSOR_FAST_UPDATE
RETURNS ( STATUS1 TIMESTAMP
, STATUS2 TIMESTAMP
, STATUS3 TIMESTAMP )
AS
DECLARE VARIABLE prod_name varchar(40);
declare variable prod_uniquenum integer;

DECLARE VARIABLE PROCEDURE_NAME VARCHAR(32);
BEGIN

status1 = 'now';

/* 2.5 times faster then next update loop */

FOR SELECT prod_name
FROM inventory FOR UPDATE
INTO :prod_name
AS CURSOR ACURSOR
DO BEGIN
UPDATE inventory SET prod_name = :prod_name
WHERE CURRENT OF ACURSOR;
END

status2 = 'now';

/* 2.5 times slower then previous update loop */

FOR SELECT prod_name,prod_uniquenum
FROM inventory FOR UPDATE
INTO :prod_name,:prod_uniquenum
DO BEGIN
UPDATE inventory SET prod_name = :prod_name
WHERE prod_uniquenum = :prod_uniquenum;
END

status3 = 'now';


SUSPEND;
END

----- Original Message -----
From: "Sean" <firebird_tmc@...>
To: <firebird-support@yahoogroups.com>
Sent: Friday, July 13, 2007 1:52 PM
Subject: [firebird-support] how to measure stored procedure performance


> Hi,
>
> I have a stored procedure w/ multiple steps. In order to measure how
> long each step takes, I output current_timestamp/current_time after
> each step. But it seems the time doesn't change.
>
> Is there a way to measure the time taken for each step?
>
> Best,
> Sean
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>