Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Total of records after delete
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01438395
Message ID:
01438433
Vues:
38
So far change area/count is a clear winner, but can you add 30 tables (cursors) opened here?

UPDATE. Adding 30 cursors didn't change a thing.

>I would add an index on deleted too
>
>
>CLEAR ALL
>CLEAR
>LOCAL lnSeconds, lnRecords, lnI
>
>SET TALK OFF
>SET ECHO OFF
>CREATE CURSOR curTest (RecNum int, charfield C(30))
>INDEX on DELETED() TAG DelRecs BINARY
>RAND(-1)
>FOR lnI = 1 TO 300000
>  INSERT INTO curTest VALUES (m.lni, PADR(m.lnI,30,'0'))
>  IF RAND() > 0.8
>  	DELETE IN curTest
>  ENDIF
>NEXT
>
>*DELETE FOR RecNum >200000
>
>SET DELETED ON
>
>SYS(1104)
>lnSeconds = SECONDS()
>SELECT COUNT(*) FROM curTest INTO ARRAY laTest
>lnRecords = laTest[1]
>RELEASE laTest
>
>?'Select COUNT(*): ', SECONDS()-m.lnSeconds, lnRecords 
>
>SYS(1104)
>lnSeconds = SECONDS()
>LOCAL lnSelect
>lnSelect = SELECT()
>SELECT curTest
>COUNT TO lnRecords
>SELECT (m.lnSelect)
>RELEASE m.lnSelect
>?'Change Area and COUNT: ',SECONDS()-m.lnSeconds, lnRecords
>
>SYS(1104) 
>lnSeconds = SECONDS()
>SELECT 1 FROM curTest TO SCREEN noconsole
>lnRecords = _tally
>?'Select to screen: ', SECONDS()-m.lnSeconds, lnRecords  
>CLOSE DATABASES all
>
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform