🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.vdbase.data.sql
Article #1

Re: Forcing vdb7 to use indices in sql-queries?

#1
From: Peter Rorlick
Date: Thu, 26 Feb 1998 00:00
30 lines
1954 bytes
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.

Can you throw some light on this?

--------------------------
Peter Rorlick
Montreal Business Software
Technical Details
Message-ID: <34F62866.E950F244@InjuryTracker.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <34F4904B.7200@ping.de> <34F49515.16C0@borland.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: Peter Rorlick <Peter@InjuryTracker.com>
Subject: Re: Forcing vdb7 to use indices in sql-queries?
Date: 1998/02/26
Message-ID: <34F62866.E950F244@InjuryTracker.com>
X-Deja-AN: 329013720
Content-Transfer-Encoding: 7bit
References: <34F4904B.7200@ping.de> <34F49515.16C0@borland.com>
X-Priority: 3 (Normal)
Content-Type: text/plain; charset=us-ascii
Organization: MBS
Mime-Version: 1.0
Newsgroups: borland.public.vdbase.data.sql,borland.public.vdbase.data.bde,borland.public.vdbase.programming