The
eddy tracks when the tuples are ready to be output to each query, and sends
the tuples back to the appropriate end-users as required.
5.4 Query Processing of TinyDB
Metadata Management
Each node in TinyDB maintains a catalog of metadata that describes its
local attributes, events, and user-defined functions. This metadata is periodically
copied to the root of the network for use by the optimizer. Metadata
is registered with the system via static linking done at compile time using
the TinyOS C-like programming language. Events and attributes pertaining
to various operating systems and TinyDB components are made available to
queries by declaring them in an interface file and providing a small handler
function. For example, in order to expose network topology to the query processor,
the TinyOS Network component defines the attribute parent of type
integer and registers a handler that returns the ID of the node??™s parent in the
current routing tree.
Event metadata consists of a name, a signature, and a frequency estimate
that is used in query optimization. User-defined predicates also have a name
and a signature, along with a selectivity estimate which is provided by the
author of the function.
Table 5. Metadata fields kept with each attribute.
Metadata Description
Power Cost to sample this attribute (in J)
Sample Time Time to sample this attribute (in s)
Constant Is this attribute constant-valued (e.
Pages:
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511