Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fragmentation - why it is usually good for VFP native da
Message
From
19/01/2003 12:04:17
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
19/01/2003 07:59:22
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00742043
Message ID:
00743265
Views:
13
Hi Jim

This is all very interesting. I think it was norton utilities that had a feature where you could put certain files at the "end" of the drive so there would be less chance of fragmentation. You said VFP does the pack in RAM and writes out segments as the RAM is filled. Does playing with sys(3050) affect this? I mean can VFP's memory footprint be increased so it has a better chance of writing out one contiguous piece?

>>>>I think this should be just better docummented in the help files. So, when working on level of single record, leave it as is. When doing time-consuming data processing, make PACK first, and then proceed.
>>>
>>>I agree that we need more/clearer information in the Help. But be surprised (as I was) that a PACK or PACK MEMO does NOT result in a defragmented .FPT file! It does get de-bloated, I assume, but the Disk Defragmenter "Analyze" shows that it remains fragmented (but with fewer fragments) after the operation.
>>>
>>
>>This is because PACK just does a copy of file on disk. If free space on disk used to store copy of file is defragmented, resulting file will be defragmented too. VFP does not do any specific control of this. It is just on the system level.
>
>No, it is not "just" controlled at the system level - VFP has a big influence on the result (how much it is fragmented). This is because, VFP having te files (DBF, CDX and FPT) EXCLUSIVE, then it knows that no one else can have access. So it can - and does - withhold any WRITE until either it runs out of RAM or hits end-of-file. So if the DBF or CDX fits totally in RAM then the whole file will be written as a single fragment. If it is too big for RAM, it will be written in a few large chunks.
>
>>
>>>>
>>>>In addition, in many our production applications we have automated administrative/maintenance tools running and making PACK and full REINDEX of every table, check for data integrity and corruption issues etc. I think, if MS would make such utility in tools for next version of VFP, it would be VERY valuable.
>>>
>>>Yes, I agree. But this is a separate issue, and be aware that a PACK and/or a full REINDEX will result in a defragmented DBF and CDX (just not the FPT). The PACK will do so, as I learned recently, only if there was at least 1 record deleted during the copy operation it does internally. If no records are dropped then the copy of the table is simply deleted and the internal REINDEX is skipped. However, the FPT processing is still performed.
>>>
>>
>>I did not knew this.
>>As about reindex, I meant complete drop of CDX file and re-creating indexes, as usually many such tools do to avoid index corruption issues.
>
>Yes, well a reindexing like that will still be as contiguous as possible because it operates too like stated above for the CBF.
>
>>
>>I think it would be extremely good if MS would place (on the system level) DBF and other files after PACK/REINDEX into the defragmented area.
>
>This it does not have control of, and I think the only way to be sure to achieve that is to defragment the volume first, but only after moving the subject DBFs and CDxs OFF that volume first, PACKing them there, then copying them back.
>
>>
>>In addition, you can schedule defragmentation of hard drive each night, for example, just after running of tools for VFP database maintenance. This should take care of this issue. Anyway, it would be extremely good to have all such tols in a single box, or at least better docummented this issue.
>
>Well if this is done, then there is a chance that some of the VFP files will end up very far from their other pieces. For instance, a .CDX could be near the start of the volume and the DBF/FPT in the big free area.
>
>By the way, using a utility called FileMon I was able to confirm that VFP does NOT make a copy of the FPT when it runs PACK or PACK MEMO. It simply re-writes parts of the existing file.
>
>cheers
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform