Subject [ib-support] FB-SP performance (REPOST)
Author Ben Johnson
On Mon, 24 Dec 2001 Ben Johnson wrote :
>
> Hi,
>
> The Stored Procedure and SELECT statement given below
> performs differently when run from IB Console as well
> as client software.
>
> CREATE PROCEDURE PRODUCT_MASTER_LOOKUP(sPrNm VARCHAR(50)
> )
> RETURNS(PRODUCT_NM VARCHAR(50),MFR CHAR(5),RACK CHAR(3),
> STOCK DECIMAL(5, 0),ID DECIMAL(5, 0))
> AS
> BEGIN
> FOR SELECT product_nm, mfr, rack, stock, id
> FROM product
> WHERE product_nm LIKE :sPrNm
> ORDER BY product_nm
> INTO :product_nm, :mfr, :rack, :stock, :id
> DO
> SUSPEND;
> END
>
> SELECT product_nm, mfr, rack, stock, id
> FROM product
> WHERE product_nm LIKE :sPrNm
> ORDER BY product_nm
>
> The query plans for both are same, but the SELECT
> statement is a lot faster than the SP. Why it is so?
>
> O.S. - W2k
> Database - Firbird-1.0.0.-RC2-Win32
>
> Thank you.
>
> Ben
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Access Your PC from Anywhere - Full setup in 2 minutes
> - Free Download
> http://us.click.yahoo.com/StuHlD/E6eDAA/yigFAA/dpFolB/TM
> ---------------------------------------------------------
> -------------~->
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>