General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
PACK - what to expect?
I've been doing test runs regarding fragmentation of VFP "native" tables/files.
This morning I wanted to confirm that my understanding of the PACK command was correct. Using VFP7 SP1 I created a table of 500,000 records, two of the fields being Memo fields. I filled the memo fields of every 4th record with information. The table has 4 fields defined as TAGs and a fifth TAG on DELETED() is also present.
After creating the table I ran the (XP-Home, SP1) Disk Defragmenter utility in "Analyze" mode and saw that there was, as expected, fragmentation of each file involved (CDX, DBF and FPT). The CDX had 374 fragments, the DBF had 1,209 and the FPT had 1,515.
Closing that and returning to VFP, I then PACKed the table in question. It proceeded as expected (incrementing 'xxxxxx records copied' in status line, then reading/analyzing the FPT) and ended normally.
Restarting the Disk Defragmenter utility once again, the "Analyze" function reported IDENTICAL numbers, suggesting that NOTHING ACTUALLY HAPPENED.
I then updated the table in question by writing content to each of the memo fields in the last 25,000 records (stepping backwards through the table). In this case the fragment count for the .FPT increased to 1,519 and all others remained the same. Results after another PACK remained unchanged. results after a PACK MEMO also proved to remain unchanged.
In NO CASE were any records ever marked DELETED in the table.
Then I deleted the last record of the table and ran a PACK. This time there was a change - no more fragmentation of the CDX and DBF but the FPT remained fragmented.
So the question at hand is obvious - under what circumstances will PACK actually DO SOMETHING?. . .the VFP Help makes no mention of the behaviour observed and, frankly, I think it is WRONG for it to operate as it does. To me I should be able to count on a PACK to do what it says it will under all circumstances. In addition, the 'threshhold' for acting on the .FPT needs documenting if things are to remain the same.
What is your opinion on the matter?
Thanks
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only