Database Reference
In-Depth Information
Prolog and the queries written are in fact Prolog terms. Still, they look quite
similar to regular SQL.
The last query from Section 3.2 can be entered into SECONDO as follows:
select [t1:id, t1:line, t2:id, t2:line,
inst(initial(intersection(t1:trip, t2:trip))) as meetingtime,
val(initial(intersection(t1:trip, t2:trip))) as meetingplace]
from [trains as t1, trains as t2]
where [t1:id < t2:id, sometimes(t1:trip = t2:trip)]
The main differences in notation are that lists need to be written in square
brackets, colon is used instead of period for qualified attributes, and names of
relations and attributes need to be written in lower case. Further, the where
clause is generally a conjunction of predicates, separated by commas rather than
a single Boolean expression.
The optimizer provides cost-based query optimization and produces a plan
in SECONDO executable language. For the query above, the following plan is
constructed.
query Trains feedproject[Id, Line, Trip] {t1}
Trains feedproject[Id, Line, Trip] {t2}
symmjoin[sometimes((.Trip_t1 = ..Trip_t2))]
{0.0238913, 0.350099}
filter[(.Id_t1 < .Id_t2)] {0.517808, 0.00916338}
extend[
Meetingtime: inst(initial(intersection(.Trip_t1, .Trip_t2))),
Meetingplace: val(initial(intersection(.Trip_t1, .Trip_t2)))]
project[Id_t1, Line_t1, Id_t2, Line_t2, Meetingtime,
Meetingplace]
consume
Due to the space limitation we will not explain this plan in detail. In addition
to query operations, the optimizer also inserts annotations into the plan such as
the selectivity of predicates and the cost of evaluating them. These are used for
query progress estimation during execution.
The user may enter this query plan directly and have it executed without
involving the optimizer. After evaluation, the result of the query is presented at
the user interface.
3.3.4 Visualization and Animation of Data Sets and Results
The graphical user interface is extensible by viewers. The Hoese-Viewer is
specialized in displaying spatial data and animating moving objects. It can
Search WWH ::




Custom Search