Article View: borland.public.vdbase.data.sql
Article #2Re: Forcing vdb7 to use indices in sql-queries?
From: Steve Koterski
Date: Fri, 27 Feb 1998 00:00
Date: Fri, 27 Feb 1998 00:00
40 lines
2477 bytes
2477 bytes
On Thu, 26 Feb 1998 21:43:50 -0500, Peter Rorlick <Peter@InjuryTracker.com> wrote: >Ken Mayer wrote: > >> Try just using a query object, and setting the SQL property to >> something >> like: "select * from customer". >> Then, set the rowset (of the query)'s indexName property to whatever >> index you need. > >Ken, I did some bench-testing yesterday on this issue. The local SQL >engine seems to ignore the opportunity of optimizing a relation through >the utilization of an existing index. My test was to create two tables >(customers and orders). I started with no indexes in the Customers >table. I wrote a program that did an INNER JOIN from Orders to Customers >(both tables have a Customer_ID field) using a Query object. A loop then >printed to the results pane >? Orders.OrderNum, Customers.Name >for every row in the rowset. It took 9 seconds. >Then I built a Customers index tag on the Customer_ID field. >Quit from VdB, started up again and ran the loop program. It took 9 >seconds again. > >My conclusion: Either I'm missing something or the local SQL engine is >passing up a golden opportunity to optimize the query. More information, please: What type of local table? dBASE or Paradox? What level table? What type of index was used? Primary or secondary? Single- or multi-column? dBASE expression index? ************************************************************************** Steve Koterski Borland International, Inc. http://www.borland.com/delphi (Remove the "SPICEDHAM2" from the address. Death to spam-bots!)
Technical Details
Message-ID:
<34f6f7c6.3971607@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<34F4904B.7200@ping.de> <34F49515.16C0@borland.com> <34F62866.E950F244@InjuryTracker.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 105c7d,d5b52dc183f66711 X-Google-Attributes: gid105c7d,public X-Google-Thread: 108edc,d5b52dc183f66711 X-Google-Attributes: gid108edc,public X-Google-Thread: ff5a1,d5b52dc183f66711 X-Google-Attributes: gidff5a1,public From: koterski@SPICEDHAM2borland.com (Steve Koterski) Subject: Re: Forcing vdb7 to use indices in sql-queries? Date: 1998/02/27 Message-ID: <34f6f7c6.3971607@forums.borland.com> X-Deja-AN: 329208510 Content-Transfer-Encoding: 7bit References: <34F4904B.7200@ping.de> <34F49515.16C0@borland.com> <34F62866.E950F244@InjuryTracker.com> Mime-Version: 1.0 Reply-To: koterski@SPICEDHAM2borland.com Content-Type: text/plain; charset=us-ascii Organization: Borland International, Technical Publications Newsgroups: borland.public.vdbase.data.sql,borland.public.vdbase.data.bde,borland.public.vdbase.programming