Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difficult in Packing Memo

Status
Not open for further replies.

sohrab100

Programmer
Jan 18, 2002
56
0
0
HK
When I issue "pack memo" command for the table with
0.8G DBF, 0.8G CDX, 1G FPT, the process start the pack in a slower rate almost 1% per hrs, but i cannot have 100 hrs' time to pack the memo, so any suggestions on this issue?
 
If you are trying to do this over a network. I would try doing it locally, either write a small exe to pack the table and put it on your server, or copy the files to a box with VFP installed on it and pack it there. Other than that my only other suggestions are more hardware, more memory and a fater processor and harddrive.
 
The program are running locally, with P4 1.6G CPU, 256M Ram, and UDMA100 harddisk, but performance is still poor, what other suggestions can help?
 
What happens if you try 'PACK DBF'? If there are a lot of deleted records, this might help reduce the size of the table so that a subsequent 'PACK MEMO' might run in a reasonable time.

Dave Dardinger
 
Hi;

Cleanup & defrag the hard drive.
When you use PACK, Microsoft Visual FoxPro copies all records not marked for deletion to a temporary table. After PACK is finished executing, Visual FoxPro deletes the original table from disk and renames the temporary table with the original table name.

Create an index on delete records
I'm not sure if PACK uses Rushmore technology but it can't hurt.

INDEX ON DELETED() TAG del

Ed
Please let me know if the sugestion(s) I provide are helpful to you.
Sometimes your the windshield... Sometimes your the bug.

 
Pack DBF is no problem, after that, Pack MEMO still with poor performance.

What if I use the following procedure:

1. set delete on
Select * from orginal_table into table new_table
2. Rebuild the index file .CDX
3. Replace the orginal_table by new_table

Remark: new_table is same name with orginal_table but in different location

Does it work? Any data lost?
 
Should work just fine, unless the table is attached to a dbc.
 
But does it pack the memos in the new table?

Dave Dardinger
 
Good question, I assumed it did, but now that I think about it I am not sure.

You could always try an experiment. Which a subset of the data of course.
 
Try this:

SELECT oldfile
COPY STRUCTURE TO newfile WITH CDX
USE newfile IN 0
SELECT oldfile
SET FILTER TO !DELETED()
SCAN
SCATTER MEMVAR MEMO
SELECT newfile
APPEND BLANK
GATHER MEMVAR MEMO
SELECT oldfile
ENDSCAN
CLOSE DATABASES
RETURN


Ed
Please let me know if the sugestion(s) I provide are helpful to you.
Sometimes your the windshield... Sometimes your the bug.

 
Eguy:

1. The method of adding index on deleted record doesn't work
2. The method of copying the one by one is not worth to do. It will still use most of RAM and CPU, and it last for as long as the prediction of "PACK MEMO" -- 4 days (at least)

What I now do is to
1. set delete on
Select * from orginal_table into table new_table
2. Rebuild the index file .CDX
3. Replace the orginal_table by new_table

It can perform in about 45 mins to do. But what I worry now, it is the destroy of recno()/order of original tale.
Will it happen? sohrab100
 
Packing a table rewrites the recno() of each record. Especilly if there are deleted records that are being removed. You should NOT use recno() for access to data records.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top