Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fast Searching
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Fast Searching
Divers
Thread ID:
00816505
Message ID:
00816505
Vues:
63
I have just finished a small application which comprises of 1 form. The user will enter a design number in the text box and the results of which are shown in a list box.
SET EXCLUSIVE OFF
SET DELETED ON
USE ("U:\Data\Modacad.dbf")

lcdesign = [modacad.key3 LIKE "%] + ALLTRIM(thisform.pageframe1.page1.text1.value) + [%"]
lcstroke = [modacad.moc042 LIKE "%] + ALLTRIM(thisform.pageframe1.page1.text2.value) + [%"]

WITH thisform.pageframe1.page1.list1
 .RowSourcetype = 3
 .Rowsource = 'SELECT mainkey FROM modacad where &lcdesign and &lcstroke'+;
              ' into cursor result'
ENDWITH
The user then selects the design number of their choice in the listbox and then clicks a button which will then find those records that match the design number. Pretty Straight forward!! The results are displayed in a grid
SET TALK ON

SET EXCLUSIVE OFF
SET DELETED off
USE ("U:\Data\Pdmlog.dbf")

SET TALK ON

LOCAL lclevel, lctype

lclevel = ' and ' + 'pdmlog.database = thisform.pageframe1.page1.combo1.displayvalue'
lctype = ' and ' + 'pdmlog.type = thisform.pageframe1.page1.combo2.displayvalue '

create cursor temp (mainkey c(fsize('mainkey','result')))
with thisform.pageframe1.page1.List1
for ix=1 to .Listcount
 if .Selected[ix]
 insert into temp values (.List(ix) )    
 endif
ENDFOR
ENDWITH

WITH thisform.pageframe1.page1.grid1
	.RecordSourceType = 4
	.RecordSource = 'Select user, database, type, date, time'+;
	             ' from ("U:\Logs\310703\pdmlog.dbf") where        temp.mainkey=pdmlog.mainkey into cursor crsmatch'
ENDWITH

SET TALK off
The only problem is it is PAINFULLY slow!! Really Slow!! There are over 3 million records in this table. Can anybody give me any ideas as to how I can speed this up!!

Many Thanks
Neil Lewis
IT R&D Manager
Velmore Ltd
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform