Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Total of records after delete
Message
From
10/12/2009 12:07:51
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01438395
Message ID:
01438429
Views:
39
>>They are very small records. So 20 thousand records in
>>a database running in a very powerfull machine that's
>>not a problem these days.
>>All operations I've done in the database are returned in
>>some miliseconds.
>>But, anyway, I will do some tests to check performance.
>>Thanks!
>>
>I ran some tests and you're right, for 20K records the performance difference is negligible. For 200K records the performance difference is more pronounced.
>
>Here is my test program
>
>CLEAR ALL
>
>LOCAL lnSeconds, lnRecords, lnI
>
>CREATE CURSOR curTest (RecNum int, charfield C(30))
>
>FOR lnI = 1 TO 300000
>  INSERT INTO curTest VALUES (m.lni, PADR(m.lnI,30,'0'))
>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  
>
>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
>
>SYS(1104) 
>lnSeconds = SECONDS()
>SELECT 1 FROM curTest TO SCREEN noconsole
>lnRecords = _tally
>?'Select to screen: ', SECONDS()-m.lnSeconds  
>CLOSE all
>
Don't forget to Set Talk Off for "'Change Area and COUNT'"
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform