# Study on Effective Temporal Data Retrieval Leveraging Complex Indexed Architecture
## 5 Data Retrieval
### Proposed Select Statement Definition  
The temporal extension of the Select statement brings an important aspect of performance. It is a cross-cutting solution of all temporal models and is based on the temporal database paradigm, which requires that user perspective and result approaches to be the same, regardless of the physical internal architecture. The proposed solution extends the definition by the following clauses:  
Figure 12: Data retrieval—complex management. * **Event_definition** This definition extends the Where clause of the Select statement, specifying the time range of data processed and retrieved, either in the form of a precise time instant (defined_timepoint) or a time interval (defined_interval), the definition of which contains two-time values--the start (BD) and end point (ED) of the interval. In the session or instance respectively, it is possible to set the type of interval (closed-closed, closed-open representation), but the user can also redefine the set access directly for a specific Select command. The second (optional) parameter is therefore the interval type used (CC--closed-closed, CO--closed-open). Note, that current database systems offer period definition by the name notation, it can be used, as well. It that case, the clause uses only one parameter, whereas the period data type always reflects CC representation:  
**defined_timepoint (t)**  
**defined_interval (t1, t2, [CC 1 CO])**  
**defined_interval (period_def)**  
The output manages individual validity intervals, if at least one timepoint is part of the defined time frame, particular state is present in the result set. Figure 13 shows the representation and usage of the CC input validity interval (expressed by the period data type physically). Note, that the database states do not need to pass the CC interval definition, thus they are automatically transformed, by using [PERSON] relationships and transformation principles [6]. Figure 14 shows the similar solution dealing with CO validity time frame. Specific type of the interval is denoted just by one timepoint. The following code shows the transformation of principles to the existing syntax, BD, ED express the inner database values, t1 and t2 represent validity intervals inside the Select statement definition:  
**defined_timepoint(t)** **where BD \(\leq\) t AND t \(\leq\) ED** **CC internally**  
**defined_timepoint(t)** **where BD \(\leq\) t AND t \(<\) ED** **CO internally**  
**defined_interval(t1,t2, CC)** **where BD \(\leq\) t2 AND ED \(>\) t1** **CO internally**  
**defined_interval(t1,t2, CO)** **where BD \(<\) t2 AND ED \(>\) t1** **CC internally**  
**defined_interval(t1,t2, CO)** **where BD \(<\) t2 AND ED \(>\) t1** **CO internally**  
**defined_interval(t1,t2, CO)** **where BD \(\leq\) t2 AND ED \(>\) t1** **CO internally**  
**defined_interval(period_def)** **where BD \(\leq\) t2 AND ED \(>\) t1** **CO internally**  
**Spatial_positions** When dealing with the spatio-temporal model, it is inevitable to cover the positional data and categorize them into the defined bucket set. When dealing with data retrieval, it is important to emphasize data correctness, relevance, and measurement precision. Figure 14: Event_definition—Closed-Open model. Figure 13: Event definition—Closed-Closed model. Missing data can be usually calculated by the neighborhood data positions, however, it is always necessary to mark such values and distinguish the measured data set from the assumed or calculated, respectively. Spatial_positions clause allows you to define an either polygon, which will delimit the data positions or radius. In this case, the data measurement frequency and precision are significant, whereas the data stream is not continuous, thus the object can be placed in the defined region just in a small term, however, such data should be placed in the result set, as well, to compose complex and reliable output. As stated in the previous chapter, the whole data map can be divided into several non-overlapping regions, which definition can be part of the proposed clause, as well.