This section explains how to use time division to limit memory usage when processing a large volume of received data by specifying the RANGE window.
When you specify the RANGE window in a query, all data received within the specified timeframe is processed. Therefore, depending on the specified time interval and the volume of data, memory usage may increase, adversely affecting system performance.
In contrast, you can keep the volume of data to be processed by the RANGE window at a constant level by specifying time division.
Time division is a facility that divides the total range of a relation specified in the RANGE window into arbitrary units of time and then processes each of these units. The divided range of the relation is called the mesh. The dividing interval (in milliseconds) is called the mesh interval.
If the amount of received data to be processed in the time range specified for the RANGE window is large, each mesh unit can be preprocessed and the results stored in the RANGE window as pseudo tuples. By making these pseudo tuples the target of processing for the RANGE window, the number of tuples in the RANGE window is kept constant. In this way, you can prevent excessive memory usage.
For example, when there are 100,000 tuples in the RANGE window, by specifying time division and preprocessing these 100,000 tuples into eight pseudo tuples, you can limit the number of tuples in memory to 8.
You can specify time division for queries that satisfy the following two conditions:
The following figure shows the differences in operations when time division is and is not specified.
Figure 2-17 Differences in operations when time division is and is not specified
When time division is not specified, all tuples in the RANGE window will be processed. For example, if the interval in the RANGE window is set to one minute and the total number of tuples that arrive in one minute is 100,000, the number of tuples to be processed is 100,000. For an operation that computes the maximum value, all 100,000 tuples must be compared in order to determine the maximum value.
On the other hand, when time division is specified, the pseudo tuples become the data being processed. Pseudo tuples are the results of the requested operation executed at the specified mesh interval. For example, if the RANGE window has been divided into eight segments by a mesh interval, eight pseudo tuples are created. For an operation that computes the maximum value, the maximum value can be determined by comparing the content of the eight pseudo tuples. In this way, specifying time division can reduce the number of tuples in the RANGE window and keep memory usage from increasing.