home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
progc
/
c_all592.arj
/
TI1004.ASC
< prev
next >
Wrap
Text File
|
1992-04-29
|
2KB
|
67 lines
PRODUCT : Paradox Engine NUMBER : 1004
VERSION : All
OS : All
DATE : April 29, 1992 PAGE : 1/1
TITLE : Packing a Database
When the Paradox Engine deletes records out of a table, it
doesn't resize the file; it simply marks the space of the record
as available. Thus, as you add records, over time you get a
bigger data file. Once you've deleted some records you can pack
them by either of two methods.
The first is to use PXTblCopy(), which will copy only non-deleted
records to a new table. Rename the old table and name the new
table with the old table name. You can delete the old table,
which you renamed, if there were no errors.
The second strategy is to use a PXCopyTableStruct() type of
function to make a new database (without a primary index), and
then add records from the original table from the bottom up.
Then, index the new table. The important point is to first add
the records to the new table and then add the primary index to
the new table. This will insure that as little as possible space
is used by the data being written to the new table.
Note that packing a database followed by adding records (when the
table has a primary index) requires a significant amount of table
reorganization when records are inserted into the table. An
unpacked table will still have room for table additions without
table reorganization. Thus, if you are still frequently adding
records to a table, you may choose to not pack the table.
Packing a table is normally only useful for tables that are not
being changed regularly.