Professional > Table scripting > Getting started > How table sequence affects population time
 
How table sequence affects population time
The table sequence directly affects the table population time. To understand this, we must first understand aggregation. When aggregating data, TOM scans data from beginning to end. The scanning is based on the HDATA structure. When variables on several tables are at the same level structure, and share the same bottom level, data aggregation is accomplished in a single pass.
What is the same level structure?
Using household.mdd as an example, person[..].trip[..].country and person[..].gender are at the same level structure because the trip level is the child of the person level. All of the variables under the two levels are at the same level structure. All variables at the top level are considered to be at the same level structure as the other levels.
Although person[..].trip[..].country and person[..].gender are at the same level structure, their level is actually different. The level for person[..].trip[..].country is person[..].trip while the level for person[..].gender is person.
What is bottom level?
A table contains several variables on the side and top. Each variable has its own level, and the lowest level is regarded as the bottom level. For example, the bottom level for the following table is person[..].trip.
Person[..].trip[..].gender>region*person[..].occupation
Variable
Level
Person[..].trip[..].gender
person[..].trip
Region
HDATA
Person[..].occupation
person
The lowest level among HDATA, person, person[..].trip is person[..].trip.
How should tables be organized?
If tables that have the same bottom level are grouped together, you can aggregate the table values in a single pass. For example, the following sequence of tables requires four passes in order to aggregate data:
Table1
region*housetype
Table2
region*person[..].occupation
Table3
region* tenure
Table4
region*person[..].gender
Now examine the following sequence of tables that only requires two passes:
Table1
region*housetype
Table2
region* tenure
Table3
region*person[..].occupation
Table4
region*person[..].gender
If each pass takes one minute to complete, the first table sequence take four minutes to populate, and the second takes two minutes.
For instructions for running the samples, see Running the sample table scripts.
See also
Getting started