Log In    |    Knowledge Base    |    4D Home
Tech Tip: Using "Fat Tables" to speed up your database
Published On: July 2, 1999

Every time 4D loads a record, it loads the whole record including the contents of every field. Most fields contains a modest amount of information, often only a few bytes. 4D has 3 has fields that can contain much more data. These are BLOB, text and picture fields. The size of these fields are based on the amount of data that they contain. Often in a database, these fields will contain a large amount of data from hundreds of bytes to many megabytes. As it takes more time to load larger amounts of data from the hard drive; the more data a record holds the slower 4D will take to load a record. The cumulative affect this can have on the speed of a database can be dramatic.

There is a simple trick that can be used to work around this issue in some situations. If a table has a BLOB, text or picture field that is not used for most operations, the field can be assigned to another table created for this purpose. This table is referred to as a fat table. The relation between the two tables must be a manual relation so that the record in the fat table is not loaded unless it is explicitly told to.

If a database is setup this way, operations that do not need the contents of the BLOB, text or picture field will not load them and will be performed faster.