At 01:37 AM 25/03/2008, you wrote: >Hi forum! >My problem is not related to the provider (thanks for your great work at this >topic, it runs perfect for me), but perhaps you can help me. > >If I run this procedure it take 1,7 seconds !!! to finish. >The code runs again a table witch have 400.000 rows and a index on field >Suchname.
1. The index isn't available if you use LIKE. 2. tmpSQL variable isn't used here 3. A cursor is much faster than a subquery 4. This is a firebird-support question. > CREATE PROCEDURE KI_SUCHEPERSONEN_HELP2( > SUCHNAME1 VARCHAR(200) CHARACTER SET WIN1252, > BEREICH VARCHAR(10) CHARACTER SET WIN1252 > ) AS > DECLARE VARIABLE tmpSQL varchar(300); > BEGIN > insert into HilfeListe(ID,Bereich) > select IDPerson, :Bereich from personen > where SuchName like :SuchName1; > END CREATE PROCEDURE KI_SUCHEPERSONEN_HELP2( SUCHNAME1 VARCHAR(200) CHARACTER SET WIN1252, BEREICH VARCHAR(10) CHARACTER SET WIN1252 ) AS DECLARE VARIABLE v_idperson Bigint; BEGIN for select IDPerson from personen where SuchName STARTING WITH :SuchName1 into :v_idperson do insert into HilfeListe(ID,Bereich) values (:v_idperson, :bereich); END HB ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider