摘要 |
A path expression, comprising a navigation path through a relationship in a schema, in an object oriented query is translated to a relational database outer join by analyzing each path expression defined in each level of the object oriented query, and by identifying each path expression which can be a candidate for a translation to an outer join. The path expressions are ordered starting with path expressions defined in a FROM clause, to which are added each path expression identified as a candidate for a translation to an outer join. These ordered path expressions are input to a select operator for each level of the object oriented query, and the ordered path expressions are grouped sequentially based upon on a source-target dependency between ordered path expressions and based upon the identifications as a candidate for a translation to an outer join. A quantifier is created for each path expression, said quantifier comprising a variable representing a table in a relational database, and each grouped path expression is replaced with a corresponding quantifier and related table in a relational database. A translation of the object oriented query to a relational query is then completed. To improve performance, an optimization may also be performed on the grouped quantifiers in which the optimization identifies quantifiers which can be a candidate for a translation to an inner join. After the optimization, an inner join is generated for each quantifier which remains a candidate for a translation to an inner join, and an outer join is generated for each quantifier which remains a candidate for a translation to an outer join.
|