摘要:
An improved method, system, and computer program product is disclosed that provides a hybrid approach to optimization which allows different subsets of data accessed by a query to be optimized with different access paths and execution approaches. Transformations may be performed to re-write the query, which restructures the query in a way that facilitates the hybrid optimization process. Multiple transformations may be interleaved to produce an efficient re-written query.
摘要:
Under automated alternate plan analysis, a query optimizer generates candidate execution plans. The candidate execution plans are selected as alternate execution plans for the query and execution. Output describing characteristics of each alternate execution plan and/or its execution is generated and/or compared. From this information, it may be determined, for example, whether results returned by any of the alternate execution plans are the same and whether the least cost execution plan is actually the most efficiently executed.
摘要:
Techniques are described herein for estimating selectivities of query predicates that reference more than one column and predicates that include column expressions. Virtual columns are defined based on column groups and column expressions. Statistics are gathered on the virtual columns and are used to estimate the selectivities of query predicates that include column groups or expressions. Query predicates that include column groups are mapped to virtual columns on which statistics are gathered, based on similarities between the column groups in the query predicates and the column groups on which the virtual columns are defined. Virtual columns are defined for column groups and expressions are specified by users or a workload analyzer that analyzes query predicates.
摘要:
Approaches, techniques, and mechanisms are disclosed for maintaining a set of baseline query plans for a database command. Except in rare circumstances, a database server may only execute a command according to a baseline plan, even if the database server predicts that a different plan has a lower cost. The set of baseline plans are plans that, for one reason or another, have been determined to provide acceptable actual performance in at least one execution context. When the database server receives a request to execute a particular command, the database server, if possible, always executes the command according to the lowest predicted cost baseline plan. The database server may evolve the plan baseline to include additional plans by generating and testing new plans in response to new requests to execute the database command, or as part of a query optimization or tuning process.
摘要:
Techniques for sharing cursors are provided. When a new query is issued, a database server determines whether the new query is semantically equivalent to a previous query. If so, then database server computes statistics associated with the new query. Based on the statistics, the database server determines whether compiling the new query would produce an execution plan that satisfies certain criteria. If so, then the cursor is used to execute the new query. In another approach, one cursor sharing technique (CST) is used to determine which cursor to use to execute a first set of semantically-equivalent queries. Statistics are gathered during execution of the first set of queries. The database server determines, based on the statistics, when to switch from using the first CST to a different CST. The different CST is used to determine which cursor to use to execute a second set of queries that are semantically-equivalent to the first set.
摘要:
A system and method including a computer shape definition language are disclosed for defining shapes and mining time sequences that resemble the shapes. The system and method include provisions for establishing a user-defined alphabet that in turn establishes a set of elemental shapes. The system also includes simple yet powerful operators for combining the elemental shapes to define a desired time sequence shape. Moreover, intervals of actual time sequences are mapped into corresponding transition sequences using the alphabet, and the transition sequences are stored in a hierarchical index structure for easily accessing the transition sequences. The index structure is entered with the desired time sequence shape, and the index structure is traversed to identify maximal actual transition sequences which conform to the desired time sequence shape, within user-definable blurry criteria.