TelegraphCQ supports introspective queriesthe state of the system. This is achieved through the dynamic catalog - a new feature in TelegraphCQ. In a traditional RDBMS, the system catalogs are used to store meta-data of user data. This meta-data could be queried just like user data. In the same vein, the TelegraphCQ dynamic catalog is used to store data that represents events happening in the system. This data appears continuously in three special streams that can be queried like any user stream.
This feature is not totally integrated in TelegraphCQ yet. To
activate the
feature, the appropriate DDL statements (in
src/test/examples/dyncat/dyncat.sql
) must be executed
against
your database, after which TelegraphCQ must be restarted.
Once this is done, you may write queries against the dynamic catalog
streams.
Currently, TelegraphCQ supports three dynamic catalog streams -
tcq_queries, tcq_operators
and tcq_queues
.
The
tcq_queries
stream captures events corresponding to the
entry
and exit of queries in the system. The tcq_operators
stream
captures events corresponding to changes in operators in the system.
The
entry of a query causes either an operator to be added or folded into
an
existing operator. Similarly, the exit of a query causes either an
operator
to be unfolded from an existing operator or removed from the system.
The
tcq_queues
stream captures events corresponding to the
queues associated with each operator. Each operator has an
input and
and output queue, and tuples are enqueued to and dequeued from these
queues.
For each such operation a tuple appears on the tcq_queues
stream.
The following tables describe in detail the schemas of each of these streams.
tcq_queries
Column | Type | Description |
tcqtime |
timestamp without time zone |
Timestamp of the event |
qrynum |
integer |
Sequentially increasing query number |
qid |
integer |
Result queue associated with this query |
kind |
character(1) |
Nature of the event:
|
qrystr |
character varying(1000) |
Query string |
tcq_operators
Column | Type | Description |
tcqtime |
timestamp without time zone |
Timestamp of the event |
opnum |
integer |
Sequentially increasing operator number |
opid |
integer |
Current operator identifier associated with this operator |
numqrs |
integer |
|
kind |
character(1) |
Nature of the event:
|
qid |
integer |
Queue that corresponds to the query that caused this operator event |
opstr |
character varying(1000) |
Exact textual description of the Node data
structure corresponding to this operator |
opkind |
character(1) |
Nature of this operator
'F' - FSteM 'G' - GSFilter 'M' - ScanModule |
opdesc |
character varying(100) |
Readable textual description of the expression associated with this operator |
tcq_queues
Column | Type | Description |
tcqtime |
timestamp without time zone |
Timestamp of the event |
opid |
integer |
Operator associated with this queue |
qkind |
character(1) |
Nature of this queue
|
kind |
character(1) |
Nature of the event
|