Hi,
this is because LIKE operator in general case CAN'T use a index.
You must equal or other operator instead.
Slavek
PS: Like in this case is dangerou because huge performance penalty
(try use second case with SuchName='%').
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Ulrich Niemand
Sent: Monday, March 24, 2008 3:37 PM
To: firebird-net-provider@lists.sourceforge.net
Subject: [Firebird-net-provider] Peformance running a procedure
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
Because the bad performance of this approch I change the procedure to this:
CREATE PROCEDURE KI_SUCHEPERSONEN_HELP(
SUCHNAME1 VARCHAR(200) CHARACTER SET WIN1252,
BEREICH VARCHAR(10) CHARACTER SET WIN1252
) AS
DECLARE VARQL = tmpSQL || ' select IDPerson, ''' || Bereich || ''' from
personen ';
tmpSQL = tmpSQL || ' where SuchName like ''' || SuchName1 || '''';
EXECUTE STATEMENT tmpSQL;
END
_____
<http://uk.rd.yahoo.com/evt=51524/*http://de.mobile.yahoo.com/interstitial?r
efer=e00127> Lesen Sie Ihre E-Mails auf dem Handy..
-------------------------------------------------------------------------
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