Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What does Pack do?
Message
From
17/06/2014 07:36:54
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01601949
Message ID:
01601953
Views:
42
>A customer has bloat on an fpt that is in near constant use. I've gone over the code to see where I might be adding in too much date, removed some fields etc. but still it run towards the 2Gb limit. I can pack the file at night time, generally after midnight but not my favourite thing to do.
#1
>Can somone tell me what pack does please, I've read the online and help stuff but it doesn't make sense to what I see and my testing.
#2
>Is there any way to reduce the size of the fpt while users are in the system?
>In a test area I have a dbf of 120mb and related ftp of 850Mb.
#3
>If I use the select command from this file into a new dbf the fpt reduces to 50mb, this is the same is deleted is set on or off.
#4
>If I use the copy to command from this file into a new dbf the fpt reduces to 50mb, this is the same is deleted is set on or off.
#5
>I then tried to select into a cursor and loop through the original file replacing the 3 memo fields with the cursor version, using a variable. The FPT got bigger. I also tried replacing the memo field with a blank first but it still got bigger. I removed the variable element and did a direct replace from the cursor.memo1 to the file, again the file got bigger.
#6
>Finally I used the file that I selected into where the fpt was reduced 50mb and did a replace into the original file. The FPT got bigger.
>~M

Hi Mark
Gregory and Tore have shown you the problem with the increasing fpt. This is number #5, #6

#1
Pack does (basically):
USE xyz
COPY TO tempfile WITH CDX
DEL xyz.*
RENAME tempfile.* TO xyz.*

#2 PACK [MEMO] needs to be exclusive

#4 See #1. COPY TO is just creating a new dbf with only the current memo data.

#3 SELECT * FROM xyz INTO TABLE i>tempfile.* ends up just like COPY TO without CDX. Only current memo data is used.

What can you do?
One solution is, on a point where you use the table, check if you can do EXCLUSIVE. Something like:
TRY
  USE xyz EXCLUSIVE
  PACK    &&or PACK MEMO
  USE
 CATCH
*just head on
ENDTRY

USE xyz
On a "near constant use" from time to time it should pack.

Lutz
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform