Exploitation of uniqueness properties using a 1-tuple condition for the
optimization of SQL queries
    1.
    发明授权
    Exploitation of uniqueness properties using a 1-tuple condition for the optimization of SQL queries 失效
    使用1元组条件来挖掘唯一性属性来优化SQL查询

    公开(公告)号:US5615361A

    公开(公告)日:1997-03-25

    申请号:US384759

    申请日:1995-02-07

    IPC分类号: G06F17/30

    摘要: The present invention optimizes SQL queries by exploiting uniqueness properties. In identifying whether the generalized 1-tuple condition exists, the query is first analyzed to determine whether any columns referenced in a predicate of the query are bound. According to the present invention, columns may be bound to constant values or correlated columns or columns that are already bound. The bound columns, if any, are then analyzed to determine whether any of the bound columns comprise a key for its associated table. If these conditions exist, then the query satisfies the 1-tuple condition, in that it returns at most one tuple. Once the generalized 1-tuple condition has been identified to exist for the query, important query transformations can be performed for optimization purposes. These query transformations comprise the transformation of scalar subqueries into joins, or the elimination of distinctiveness requirements (i.e., DISTINCT keywords) from SELECT clauses.

    摘要翻译: 本发明通过利用唯一性来优化SQL查询。 在识别广义1元组条件是否存在时,首先分析查询以确定查询谓词中引用的任何列是否被绑定。 根据本发明,列可以绑定到已经结合的常数值或相关的列或列。 然后分析绑定的列(如果有的话),以确定任何绑定列是否包含其关联表的键。 如果这些条件存在,则查询满足1元组条件,因为它最多返回一个元组。 一旦确定了查询的广义1元组条件,就可以执行重要的查询转换来进行优化。 这些查询转换包括将标量子查询转换为联接,或从SELECT子句中消除明确性要求(即DISTINCT关键字)。