Article View: borland.public.interbase.sql
Article #11341Re: Including wild characters as query parameters
From: Craig Stuntz TeamB
Date: Fri, 22 Nov 2002 14:53
Date: Fri, 22 Nov 2002 14:53
28 lines
2423 bytes
2423 bytes
In article <3ddd565d$1@newsgroups.borland.com>, nkarasev@e-dn.com says... > However, in this case MSSQL is a lot more stable and what's more important > alot faster than Interbase. > You need to understand how IB's indices work. IB string indices work from the beginning of the string forward. They're not useful for locating substrings in the middle of a string field. So if you're searching for a substring at the beginning of a string field, you need to make sure that IB knows this. You can use STARTING WITH instead of like (no wildcards in STARTING WITH), or you can use LIKE with a constant expresssion and no wildcard at the beginning. If you use LIKE with a parameter, however, IB doesn't know whether you're looking for a constant, a substring with a wildcard at the end, or a substring with a wildcard at the beginning, so the optimizer won't be able to specify the use of the index. *When an index is used* IB should be comparable to SQL Server on similar hardware in this case. If SQL Server is using an index and IB is not, then of course SQL Server will be faster. -Craig -- Craig Stuntz [TeamB] � Vertex Systems Corp. � Columbus, OH Delphi/InterBase Weblog : http://delphi.weblogs.com InterBase Perf. Monitor : http://delphi.weblogs.com/IBPerformanceMonitor InterBase PLANalyzer 1.1: http://delphi.weblogs.com/IBPLANalyzer
Technical Details
Message-ID:
<MPG.18480ee333660d0e98a225@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-01!sn-xit-04!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3ddd1f84$1@newsgroups.borland.com> <MPG.1846efc4415664e698a20d@newsgroups.borland.com> <3ddd565d$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 114a0e,51c524b53d1ed866,start X-Google-Attributes: gid114a0e,public X-Google-ArrivalTime: 2002-11-22 07:09:32 PST From: Craig Stuntz [TeamB] <cstuntz@nospamplease.com (but use vertexsoftware to email)> Newsgroups: borland.public.interbase.sql Subject: Re: Including wild characters as query parameters Date: Fri, 22 Nov 2002 09:53:16 -0500 Message-ID: <MPG.18480ee333660d0e98a225@newsgroups.borland.com> References: <3ddd1f84$1@newsgroups.borland.com> <MPG.1846efc4415664e698a20d@newsgroups.borland.com> <3ddd565d$1@newsgroups.borland.com> Organization: Vertex Systems Corporation X-Newsreader: MicroPlanet Gravity v2.60 NNTP-Posting-Host: 65.86.87.242 X-Trace: newsgroups.borland.com 1037976704 65.86.87.242 (22 Nov 2002 06:51:44 -0800) Lines: 28 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-01!sn-xit-04!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail