On Oct 25, 2016, at 12:13 PM, [email protected] wrote:

> Additional note:  Based on the MSC logs, “Checking list of deleted records…” 
> is performed for every table in a 4D application.  Only if there are a number 
> of these deleted records to verify does it show in the MSC UI.  We have an 
> app with 300 tables (!).  30 to 40 show a progress bar during "Checking list 
> of deleted records…”  This is adding ~15+ minutes to a verify.  I am not sure 
> if having these hidden/deleted records is also negatively impacting app 
> performance.  Investigating…

I believe this all has to do with what is called the “record address table” 
that 4D maintains in the data file. This is used to keep track of where in the 
data file each record is stored. 

When you delete a record, 4D does things to the data file to make the space the 
record occupied available again to be reused. But it does this in a certain way 
so that record numbers are maintained. This is where the “list of deleted 
records” comes into play. 

When you do a TRUNCATE TABLE, 4D does a special operation where it deletes all 
records, makes the space for all the deleted records available again and 
removes the list of deleted record. All of these operations do not occur if you 
do DELETE RECORD or DELETE SELECTION even when you delete all records in the 
table. The record address table does not get reset and the list of deleted 
records is maintained. 

To force the record address table to be “reset” and rebuilt to not include a 
list of deleted records you need to use MSC to “Compact" the data file. Click 
the “Advanced” button. You will see 2 options. First one is “Force updating of 
the records”. In this situation it does not apply, but you still need to check 
it so that you can access the second option. “Compact address table” is what 
you need to turn on. This will result in a clean record address table with no 
holes and it will remove the list of deleted records, since there are none. 

The general rule is if you have a table with a large percentage of records that 
have been deleted you can improve performance if you compact the data file and 
compact the address table. 

Example: you have a table that at one time had 1,000,000 records. Now the table 
only has 1,000 records. Doing a compact of the address table should result in a 
performance improvement when doing operations on that table. 

Be aware that when you compact the address table it can change the record 
numbers. This can cause any saved sets to become invalid. It also makes old 
journal files no longer integratable (is that a real word?). 

Bottom line, compact the data file, compact the address table and this will fix 
your “problem”. 

Tim

********************************************
Tim Nevels
Innovative Solutions
785-749-3444
[email protected]
********************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to