KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Maintenance of Low Record Count Tables with Records Created and Deleted Soon After
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: August 26, 2024

Some implemetations of features may utilize a table to store data for a short while. A record is created to store the data and then after the procedure completes and the data is not needed anymore the record is deleted afterwards.

This can cause issues with queries on the table when the number of deleted records becomes high. 4D attempts to optimize its query and when the record count is low, it may decide that it is more efficient to perform a sequential search. However, due to all of the old deleted records the fragmentation cause by them can cause the sequential search to be slower when parsing through the address tables.

Two ways to avoid this issue is to:
A) Perform a Compact Regularly
B) Truncate the specific table(s) Regularly

Both cases will reduce the fragmentation and rebuild the index address tables.