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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Btrieve file size doesn't decrease when I delete

Status
Not open for further replies.

v8dan

Technical User
Oct 21, 2002
7
GB
When a betrieve record is deleted out of a btrieve table, the file size doesn't decrease (Just out of interest I am interested to know what happens to this record, is it filled with ascii zero's?)

I am left with a situation where if I delete loads and loads of records from a LARGE betrieve table, the file continues to be as big. Is there any purging tools or even functionality within butil to clear out of these deleted records?

Your response is appreciated!
 
When a record is deleted from the Btrieve file, the entries in the PAT and KEY are removed. The record is not "zeroed" out but it marked as free space. Which is why the file doesn't shrink. The Pervasive engine will reuse that space the next time an insert is done. You can remove this extra space by using BUTIL (-CLONE and -COPY) or a third party tool like the Btrieve Rebuild DLL (available at if you want to do it programmatically.
info@mirtheil.com
Custom VB and Btrieve development.
Certified Pervasive Developer
Certified Pervasive Technician
 
Thank you kindly Mirtheil.

I am probably being a bit thick, but what is PAT? I assume it is Pervasive something or other.

 
PAT is the Page Allocation Table. It's an internal Pervasive structure for storing the pages that store the data.
info@mirtheil.com
Custom VB and Btrieve development.
Certified Pervasive Developer
Certified Pervasive Technician
 
Thanks for the advice/information Mirtheil.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top