Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PACK - what to expect?
Message
From
13/01/2003 11:03:22
 
 
To
13/01/2003 10:46:02
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00740999
Message ID:
00741006
Views:
17
Jim

I'm no expert but heres my opinion FWIW: To me the observed behaviour seems OK. Here's why:


>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.

PACK will only "do something" if it has something to do i.e. there are deleted records. Unless you use PACK MEMO in which case it will recreate the FPT file removing redundant data - if there is any.


>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.

IMO correct behaviour. You added data to the memo field only so potentially more fragmentation would occur in the FPT file.


>Results after another PACK remained unchanged.

Again, no deleted records so nothing to do.


>results after a PACK MEMO also proved to remain unchanged.

This seems a little strange since there should have been some redundent data created in every 4th record that you already had data in the memo field for. So by adding/replacing new memo data there should at least have been (a) an increase in the size of the FPT file and (b) potentially some further fragmentation. What "remain unchanged" exactly?


>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.

When you PACK VFP will re-write the DBF and CDX file to a new location without the records marked for deletion. The OS will decide where the files get re-written to physically on the HD. The OS may use sectors not large enough to accomodate the entire file - hence some files may still be fragmented.


>So the question at hand is obvious - under what circumstances will PACK actually DO SOMETHING?.

When there are deleted records or redundent data in the memo fields. PACK does not defrag the file but removes redundent data. Where the subsequent file is written, and how, is up to the OS.

Now, where are the experts :)
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform