Database Reference
In-Depth Information
in Section 2.2 (refer Figure 2.4 ). Query 2.3 is sent by the root node of
the SRT to its children that are a part of the query response. The child
nodes check whether the sensor value they have sensed is greater than
10 C. If the sensor value is greater than 10 C at a child node, then
that child node appends its sensor identifier to the query response. The
child node, then, forwards the query to its children and waits for their
response. Once all the children of a particular node have responded,
then that node forwards the response of its entire sub-tree to its parent.
In the end, the root node receives all the sensor identifiers s j that have
recorded temperature greater than 10 C.
SELECT s j FROM sensor values WHERE v ij > 10 C AND t i == NOW()
Query 2.3: Return the sensor identifiers s j where v ij > 10 C.
4.2 Model-Based Views
The MauveDB [18] approach proposes standard database views [19] as
an abstraction layer for processing queries. These views are maintained
in a form of a regression model; thus they are called model-based views.
The main advantage of this approach is that the model-based view can
be incrementally updated as fresh sensor values are obtained from the
sensors. Furthermore, incremental updates is an attractive feature, since
such updates are computationally ecient.
Before processing any queries in MauveDB, we have to first create a
model-based view. The query for creating a model-based view is shown
in Query 2.4. The model-based view created by this query is called
RegModel . RegModel is a regression model in which the temperature is
the dependent variable and the sensor position ( x j ,y j ) is an independent
variable (refer Figure 2.9 ). Note that RegModel is incrementally updated
by MauveDB. At time t 1 values from sensors s 1 , s 3 and at time t 2 the
value from sensor s 2 are respectively used to update the view. The view
update mechanism exploits the fact that regression functions can be
updated. Further details regarding the update mechanism can be found
in [18].
CREATE VIEW RegModel AS FIT v OVER x 2 ,xy,y 2 ,x,y
TRAINING DATA SELECT x j ,y j ,v ij FROM sensor values
WHERE t i >t start AND t i <t end
Query 2.4: Model-based view creation query.
Once this step is performed many types of queries can be evaluated
using the RegModel view. For instance, consider Query 2.5. MauveDB
Search WWH ::




Custom Search