摘要:
A technique and mechanism for transforming a query is described. A given query is transformed into a transformed query that references a global temporary table. Specifically, the given query contains a join between a given table and one or more other tables referenced by constraints (e.g. predicates). References to one or more of the constrained tables are replaced by a reference to a global temporary table. Before executing the transformed query, data that satisfies the constraints placed on the constrained table is inserted into the global temporary table.
摘要:
A method and mechanism is provided for executing a query that includes a subquery, where the subquery includes an ORDER BY clause. The results generated by executing the subquery are ordered as specified by the ORDER BY clause. When the results of the subquery are referenced by the outer query, the results generated for the subquery satisfy the restriction. For example, the restriction may specify that the row number pseudo-column be less than a threshold. In response, a TOP N operation is performed to return the rows that are TOP N in order. The order is based on the ORDER BY clause.
摘要:
A method and apparatus for processing star queries is provided. According to the method, a star query is transformed by adding to the star query subqueries that are not in the query. The subqueries are generated based on join predicates and constraints on dimension tables that are contained in the original query. The subqueries are executed, and the values returned by the subqueries are used to access one or more bitmap indexes built on columns of the fact table. The bitmaps retrieved for the values returned by each subquery are merged to create one subquery bitmap per subquery. An AND operation is performed on the subquery bitmaps, and the resulting bitmap is used to determine which data to retrieve from the fact table.
摘要:
Techniques are provided for executing distinct aggregation operations in a manner that is more scalable and efficient than prior techniques. A three-stage technique is provided to parallelize aggregation operations that involve both grouping and multiple distinct-key columns. Such queries are handled by splitting rows into as many pieces as there are distinct aggregates in the query, and processing the row pieces. During the first-stage, a set of slave processes scans the rows of the base tables and performs partial duplicate elimination. During the second-stage, a set of slave processes completes the duplicate elimination and performs partial set function aggregation. During the third-stage, a third set of slave processes completes the set aggregation to produce the results of the distinct aggregation operation. In addition, two-stage parallelization techniques are provided for parallelizing single-distinct aggregations, and for parallelizing distinct aggregation operations that involve multiple distinct-key columns, but do not require grouping.
摘要:
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.
摘要:
A method and apparatus for generating and using bitmaps in a database system that employs multi-level identifiers is provided. The generated bitmaps include bits that correspond to the identifiers that have been assigned to existing records, as well as bits that correspond to all intervening multi-level identifiers that have not yet been assigned. Therefore, when new rows are inserted into the table associated with the bitmap, new bits do not have to be inserted into the existing bitmap. When existing rows are deleted, the bits that correspond to the deleted rows are not themselves deleted, but are simply set to a value that indicates that the corresponding row does not satisfy the criteria associated with the bitmap.
摘要:
Sort plus operations such as "group by" and "distinct" generally require sorting of the retrieved data before performing the sort plus operation. A method and apparatus is disclosed for executing a query specifying a sort plus operation without performing the sorting operation. To perform the sort plus operation, it is determined whether a sorted source exists that can be used to obtain the data specified in the query. If the sorted source does exist, it is then used to perform the sort plus operation.
摘要:
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.
摘要:
A method and mechanism is disclosed for implementing storage and retrieval of data in a computing system. Data compression is performed on stored data by reducing or eliminating duplicate values in a database block. Duplicated values are eliminated within the set of data that is to be stored within a particular data storage unit. Rather than writing the duplicated data values to the data storage unit, the on-disk data is configured to reference a symbol table a single copy of each duplicated data value. Column reordering may be performed in an embodiment to further improve compression efficiency. The column reordering may be performed to allow efficient removal of trailing NULL values from on-disk storage.
摘要:
A method and mechanism is described for indexing a body of records. An index associates ranges with records that hold key field values that fall within those ranges. Such an index may be implemented as a bitmap index. The bitmap index may contain entries that associate a range with a bitmap. The bitmap of an index entry identifies which records have a key field value that falls within the range associated with the entry. The index may be a native index maintained by a database system. The database system uses the index to efficiently process queries that specify range criteria.