next up previous contents
Next: Constructing an OPM Up: The OPM Multidatabase Previous: The Multi-Database Directory

Multidatabase Query Processing

An OPM multidatabase query is first partitioned into several single class OPM_QL queries. Conditions in a multidatabase query involving only a single class are generally incorporated in the component OPM_QL query for that class, while conditions involving multiple classes, possibly from different databases, are evaluated by the OPM*QL processor.

An OPM multidatabase query is processed as follows.

  1. Given a multidatabase query, SELECT S FROM CS WHERE Conds;, for each class specification DB:C appearing in CS (where DB is a database name, and C is a class name), an OPM_QL query for C, is generated:

    SELECT FROM C WHERE Conds;

    where

    1. consists of each attribute path Y such that DB:C.Y occurs either in S or in Cond.
    2. Conds consists of those conditions in Conds involving only constant terms and terms of the form DB:C.Y for some attribute path Y: that is Conds does not involve any references to other classes DB:C where or .

    The query is formed by first filtering the abstact syntax tree for the multidatabase query to remove any parts involving classes other than DB:C, and then translating the query back into OPM_QL, replacing any terms of the form DB:C.Y with the attribute path Y. If Conds is empty then the WHERE keyword is omitted.

  2. Each query is submitted to the database DB, and the resulting set of tuples, , is converted into the internal representation of the multidatabase query engine.

  3. A set of conditions Conds is formed, consisting of those conditions in Conds involving multiple distinct classes. The values are then searched for sets of tuples satisfying the conditions, Conds, and suitable sets of tuples are then projected, renamed and combined in accordance with the select statement S.

Example.Consider the following query expressed over the HGD (GDB) and GSDB databases:

       SELECT Name = GSDB:Gene.name, Reason = HGD:Gene.reason,
              Annotation = HGD:Gene.annotation
       FROM GSDB:Gene, HGD:Gene
       WHERE HGD:Gene.accessionID = GSDB:Gene.gdb_xref
                                       AND   GSDB:Gene.name = "ACHE" ;

First, the following two OPM_QL queries are generated:

Query :

       SELECT name, gdb_xref
       FROM Gene
       WHERE name = "ACHE";

Query :

       SELECT reason, annotation, accessionID
       FROM Gene;

For each object instance x returned by , and each object instance y returned by , if accessionID of y is identical to gdb_xref of x, then return: Name = x. name, Reason = y. reason, Annotation = y. annotation.



next up previous contents
Next: Constructing an OPM Up: The OPM Multidatabase Previous: The Multi-Database Directory



& Markowitz
Wed Jan 17 16:39:09 PST 1996