Article View: borland.public.vdbase.data.sql
Article #762HELP!! DBASE + SQL = WAY TOO SLOW!!!
From: Steve Levine
Date: Mon, 13 Jul 1998 00:00
Date: Mon, 13 Jul 1998 00:00
34 lines
1805 bytes
1805 bytes
I am currently trying to run a query against 3 joined dbase 5.0 tables
with approximatly 30,000 records. Unfortunatly the nature of the queries
usualy cause them to return about 90% of the records, and this usually takes
a few minutes. which is too long. is there a way i can retrieve the result
set 50 records or so at a time instead of all at once, in other words fetch
the first 50, then the next 50 at the press of a button and so on and so
forth. if not is there any way i can speed the query up. this is my code,
if it helps:
sSQL := 'SELECT BID, SKEY1, UKEY1, CLOSE_DT, ' +
'FUND_DT, Q_STATUS, DOC_DESC, DEF_DESC, RESP_AREA, ' +
'STAT_CODE, DOC_CODE, DEF_CODE, CORP_DEF ' +
'FROM DEFICIEN, DEFIC_Q, FOLDERS ' +
'WHERE ' +
'(DEFICIEN.BID = DEFIC_Q.BID) AND ' +
'(DEFICIEN.SKEY1 = DEFIC_Q.SKEY1) AND ' +
'(DEFICIEN.BID = FOLDERS.BID) AND ' +
'(DEFICIEN.SKEY1 = FOLDERS.SKEY1) AND ' +
'(DEFIC_Q.Q_STATUS <> "T") AND ' +
'(DEFIC_Q.Q_STATUS <> "P") ' + sFilterStr +
'ORDER BY ' + sSortFields;
tblDQueue.SQL.Clear;
tblDQueue.SQL.Add(sSQL);
try
tblDQueue.Active := True;
except on EDatabaseError do
begin
MessageDlg('Unable to open table "' + tblDQueue.Name +
'".',mtError,[mbOK],0);
Exit;
end;
end;
Technical Details
Message-ID:
<6odq40$2br3@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,df2ee0fbdac9fd39,start X-Google-Attributes: gidff5a1,public From: "Steve Levine" <slevine@ucg.com> Subject: HELP!! DBASE + SQL = WAY TOO SLOW!!! Date: 1998/07/13 Message-ID: <6odq40$2br3@forums.borland.com> X-Deja-AN: 371106227 Organization: Another Netscape Collabra Server User X-MimeOle: Produced By Microsoft MimeOLE V4.72.2106.4 Newsgroups: borland.public.vdbase.data.sql