Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fragmentation - a simple benchmark
Message
From
03/01/2003 07:43:47
 
 
To
03/01/2003 01:10:17
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00737567
Message ID:
00737638
Views:
18
Al,

I figured someone would ask < s >. I was tired from all the reboots/runs and didn't include in the message, but here goes...
>Interesting results. A few questions for clarification:
>
>- Were the SEEKs random?
The seeks were as random as I cared to make them < s >. Here's the code, explained afterwards:
SCAN
    DO CASE 
        CASE MOD(RECNO("SeeksList"), 4) = 0  && divisible by 4?
            =SEEK(SeeksList.StartLow, "Frag01", "StartLow")
            =SEEK(SeeksList.StartLow, "Frag02", "StartLow")
            =SEEK(SeeksList.StartLow, "Frag03", "StartLow")
            
        CASE MOD(RECNO("SeeksList"), 3) = 0  && divisible by 3?
            =SEEK(SeeksList.StartHigh, "Frag01", "StartHigh")
            =SEEK(SeeksList.StartHigh, "Frag02", "StartHigh")
            =SEEK(SeeksList.StartHigh, "Frag03", "StartHigh")
            
        CASE MOD(RECNO("SeeksList"), 2) = 0  && divisible by 2?
            =SEEK(SeeksList.LongChar, "Frag01", "LongChar")
            =SEEK(SeeksList.LongChar, "Frag02", "LongChar")
            =SEEK(SeeksList.LongChar, "Frag03", "LongChar")
            
        OTHERWISE                            && none of above
            =SEEK(SeeksList.ShortChar, "Frag01", "ShortChar")
            =SEEK(SeeksList.ShortChar, "Frag02", "ShortChar")
            =SEEK(SeeksList.ShortChar, "Frag03", "ShortChar")
    ENDCASE 
ENDSCAN
The SCAN is on a 5,000 record table where the keys for every 100th record of the tables were extracted (all tables have same keys, generated at same time).
"StartLow" is INT, starting at 1, +1.
"StartHigh" is INT starting at 2,147,000,000, -1.
LongChar is C(16), starting at "0000000000000001", + "1"
"ShortChar" is C(10), starting at "0010000000", - "1".
I felt that consistency across all runs was more important that true randomness.

>- What were the SQL statements you used?
Here are the SQLs:
SELECT Frag01.StartHigh, Frag01.Memo1a  ;
    FROM C:\VFPmisc\Frag01, C:\VFPmisc\SeeksList  ;
    WHERE Frag01.StartLow = SeeksList.StartLow  ;
      AND Frag01.ShortChar = SeeksList.ShortChar  ;
    INTO CURSOR FromFrag01

SELECT Frag02.StartLow, Frag02.Filler1  ;
    FROM C:\VFPmisc\Frag02, C:\VFPmisc\SeeksList  ;
    WHERE Frag02.StartHigh = SeeksList.StartHigh  ;
      AND Frag02.LongChar = SeeksList.LongChar  ;
    INTO CURSOR FromFrag02

SELECT Frag03.ShortChar, Frag03.Memo1c, Frag03.Memo2c  ;
    FROM C:\VFPmisc\Frag03, C:\VFPmisc\SeeksList  ;
    WHERE Frag03.StartHigh = SeeksList.StartHigh  ;
      AND Frag03.ShortChar = SeeksList.ShortChar  ;
    INTO CURSOR FromFrag03
*
* Above 3 in single prg, below alone in prg
*
SELECT Frag01.StartHigh, Frag01.Memo1a,  ;
       Frag02.StartLow, Frag02.Filler1,  ;
       Frag03.ShortChar, Frag03.Memo1c, Frag03.Memo2c  ;
    FROM C:\VFPmisc\Frag01,  ;
         C:\VFPmisc\Frag02,  ;
         C:\VFPmisc\Frag03, C:\VFPmisc\SeeksList  ;
    WHERE Frag01.StartLow = SeeksList.StartLow  ;
      AND Frag01.ShortChar = SeeksList.ShortChar  ;
      AND Frag02.StartHigh = SeeksList.StartHigh  ;
      AND Frag02.LongChar = SeeksList.LongChar  ;
      AND Frag03.StartHigh = SeeksList.StartHigh  ;
      AND Frag03.ShortChar = SeeksList.ShortChar  ;
    INTO CURSOR FromAllFrags
I think they are pretty straight-forward, but I must mention that a CLOSE TABLES ALL and a SYS(1104) was issued between each SELECT.
But one thing is VERY worth noting (I know that other mention this often too, but it was so pronounced here... In testing prior to final runs I would re-run the 3-stmt prg and response would be 1 second or less for each!!! For kicks I tried also after stopping/restarting VFP, with same result. I continue to be amazed at how Windows keeps track of data even after it's 'user' has terminated. Obviously great design in there!!!

>- Sizes of hardware buffers on HDs? Although, the link I posted would have you believe they don't make *that* big a difference to overall HD performance

Unknown, though my guess is the desktop has 2 meg and the notebook 0.
But I can say that system RAM had a noticeable effect. The desktop had all CDXs created without fragments until I added FLUSH in creating them. The notebook did similar, but its smaller RAM caused 3 fragments (without FLUSH).

>- Were you able to eliminate the effects of OS disk caching in your tests?

No, I was not able, OTHER than rebooting between each program run on each machine. I left VFPs RAM parameters as delivered too.

It took a long time to get to sleep last might, just thinking through the results obtained. Still no firm conclusions here < s >.

cheers, and Happy New Year Al.

>
>On a minor note, I assume you meant "NTFS" in those places where you wrote "HPFS" as the HD file system.

Ooops - you are right about that. I guess OS2 is still in my head < s >
Previous
Reply
Map
View

Click here to load this message in the networking platform