摘要:
A method, apparatus, system, and signal-bearing medium that, in an embodiment, determine performance data for query optimization of a query directed to a database table having multiple partitions. The performance data for the query optimization is presented in a user interface, and an option is provided in the user interface to create a non-spanning index for any of the partitions mentioned in the performance data. In various embodiments, determining the performance data may include: determining the partitions that were unexpanded by the query optimization, determining the partitions that had a runtime estimate that was different from an actual query runtime by a threshold, determining whether any of the partitions had expansion forced by a client request, determining whether the query performed partition elimination, determining whether any of the partitions has an associated index that is unused by the query and that also has a key that is not present in all of the partitions, and determining a constraint for partition elimination.
摘要:
A query facility for database queries dynamically determines whether selective portions of a database table are likely to benefit from separate query execution strategies, and constructs an appropriate separate execution strategies accordingly. Preferably, the database contains at least one relatively large table comprising multiple partitions, each sharing the definitional structure of the table and containing a different respective discrete subset of the table records. The query facility compares metadata for different partitions to determine whether sufficiently large differences exist among the partitions, and in appropriate cases selects one or more partitions for separate execution strategies. Preferably, partitions are ranked for separate evaluation using a weighting formula which takes into account: (a) the number of indexes for the partition, (b) recency of change activity, and (c) the size of the partition.
摘要:
A database facility supports database join queries in a database environment having at least one database table divided into multiple partitions based on a partition key value. The facility determines whether the values in a table joined to the partitioned table place an implicit limitation on the partition key, and eliminates from query evaluation any partitions which do not satisfy the implicit limitation. Preferably, the database uses a star schema organization, in which implicit limitations in a relatively small dimension table are used to eliminate partitions in a relatively large fact table.
摘要:
A visual query explain mechanism displays a query to the user in a graphical tree format. A user may execute a query, and the actual performance from executing the query is imported into the visual query explain mechanism. The visual query explain mechanism adds the actual performance to the nodes in the query tree, and compares the actual performance to the estimates of performance that were generated prior to executing the query. The visual query explain mechanism then looks at a predefined threshold value, and determines whether actual performance exceeds the estimated performance by the predefined threshold value. If so, the corresponding node in the query graph is highlighted in some way, thereby providing a visual indication to the user of problem areas in the query.
摘要:
A latent auxiliary database structure constructed for executing a query is automatically saved for reuse in subsequent query execution instances. The latent auxiliary database structure is not maintained concurrently with changes to records in the database tables. If a query execution strategy is subsequently invoked which uses the latent auxiliary database structure, a determination is made dynamically whether to update the previously saved latent structure from database changes recorded in one or more change logs, or to rebuild the latent structure from scratch. Where the cost of updating from the change log is deemed less than the cost of a rebuild from scratch, the previously saved latent structure is updated from the log.
摘要:
A query optimizer optimizes a query to a partitioned database table by determining common characteristics of the partitions and generating a virtual maintained temporary index that spans multiple partitions. Using the virtual maintained temporary index allows the query optimizer to generate an access plan based on the virtual maintained temporary index, which relieves the optimizer from having to individually optimize access to each partition for partitions that share common characteristics.
摘要:
Enabling a user to obtain and view graphic explain data with no need to activate a monitor and no need to wait for a job to complete before the explain data for a query may be viewed. Displaying explain data for an SQL query of a database that include executing an SQL query and displaying explain data for the SQL query while executing the SQL query. Displaying explain data includes identifying an access plan associated with the SQL query and generating explain data in dependence upon the access plan. Identifying an access plan may be carried out by retrieving an access plan identification from a cursor of a job control block and retrieving an access plan from an access plan cache in dependence upon the access plan identification.
摘要:
In one aspect, a database analytical tool or function analyzes join queries to detect queries which could be reduced if a referential integrity relationship were known. In another aspect, a probable latent referential integrity relationship is detected using one or more heuristics. Preferably, a join query is analyzed to detect a joined table which has no other conditions placed on it, and no referential integrity relationship already defined. For any such query, the analysis attempts to verify a probable latent referential integrity relationship using at least one heuristic, such as comparing cardinality of the potential primary key with the size of the table and/or with the cardinality of the foreign key. It is further possible to execute the join for some sample of records, and determine whether any records were found which did not conform to referential integrity constraints.
摘要:
A database application re-uses one or more query execution strategies for a given logical query, and saves historical data concerning query execution performance under differing execution parameters. The historical data is analyzed to identify environmental variables and/or imported variables which significantly affect execution performance. Preferably, an auxiliary data structure includes, for each of multiple execution strategies, a respective set of imported and environmental variables and respective average cost measure, such as execution time. An analytical tool compares multiple different strategies to identify imported and/or environmental variables which caused a different strategy to be used, and resultant average cost. Preferably, the tool can also compare variation within the same strategy.
摘要:
A query facility for database queries saves and re-uses query execution strategies, and automatically determines whether a strategy can be re-used when an imported variable changes. The query facility automatically saves one or more logical conditions associated with the one or more imported variables in the query. When the query is reused, the logical conditions are evaluated using the imported variable values, and the previously saved execution strategy is used only if the condition or conditions are met. Preferably, the logical conditions express a range of imported variable values which are included in a database subset data structure used by the saved query execution strategy, such as a materialized query table or partitioned table. Logical conditions are preferably generated by negating the predicates from a logical expression defining the applicability of the execution strategy, inserting the negated predicates into the query, and performing a transitive closure.