Generalized Order Data Structure for Database Query Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current database management systems face inefficiencies in query optimization, particularly in handling complex queries with ordered data, due to limitations in representing and matching order properties, leading to increased memory usage and suboptimal execution plans.

Innovation Solution

The introduction of a generalized order data structure that can represent sets of simple orders in a single data structure, allowing for efficient matching and reduction of order properties, and the use of dependency pointers to guide the optimization process, enabling memory-efficient join enumeration and improved query planning.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If traditional simple order data structures are used to represent order properties in query optimization, then the system can handle basic ordering requirements, but it leads to increased memory usage and inability to efficiently represent complex order requirements

Engineering Contradiction:
Improveability to represent order propertiesVSAvoidmemory usage
Core Design Contradiction:
Adaptability or versatilityVSQuantity of substance

Solution Approach 1:

The patent merges multiple simple order representations into a single generalized order data structure. The GenOrder structure combines an array of order specifications (expr, seq, fixed) with a wildcard set, allowing it to represent multiple simple orders simultaneously. This consolidation reduces the memory overhead of storing separate data structures for each simple order while maintaining the ability to represent complex order requirements through the wildcard mechanism.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The generalized order data structure serves multiple functions: it can represent a single simple order, multiple simple orders, and sets of simple orders through wildcards. The structure is universal enough to handle both basic ordering requirements and complex order sets, replacing the need for multiple specialized data structures. This multi-functionality improves adaptability while reducing memory usage through a unified representation.

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Measurement precision

If multiple simple orders are represented separately, then each order can be precisely defined, but the system complexity and computational overhead increase

Engineering Contradiction:
Improveorder property definition accuracyVSAvoiddata structure complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

Multiple simple order definitions are merged into a single generalized order structure. The GenOrder consolidates multiple (expr, seq, fixed) tuples into one data structure, reducing the number of separate objects the optimizer must manage. This merging maintains precise order property definitions while reducing structural complexity and the overhead of managing multiple independent data structures.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent adds a wildcard dimension to the order representation. By introducing wildcards that can match multiple expressions, the system transitions from representing individual simple orders to representing sets of orders in a single structure. This dimensional addition allows precise definition of order properties while simplifying the overall data structure through set-based representation.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

3Reliability

If the query optimizer enumerates all possible join strategies without optimization, then complete search space coverage is achieved, but execution time and computational resources are excessive

Engineering Contradiction:
Improveoptimization completenessVSAvoidquery optimization time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system performs preliminary actions by pre-computing and storing generalized order information for each subplan during the bottom-up optimization process. By calculating and caching order properties in advance, the optimizer avoids redundant computations during the join strategy enumeration phase. This preliminary computation maintains complete search space coverage while reducing the time required for the optimization process.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The optimizer uses feedback from previously computed generalized orders to guide the join strategy enumeration. By maintaining order property information from subplans and using it to evaluate potential join strategies, the system avoids re-computing order properties repeatedly. This feedback mechanism ensures complete exploration of the search space while significantly reducing computational time through intelligent reuse of previously computed information.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS7359922B2Database system and methodology for generalized order optimization
Publication Date: 2008.04.15 IANYWHERE SOLUTIONS INC
  • US7359922B2 patent drawing
  • US7359922B2 patent drawing
  • US7359922B2 patent drawing

AI summary

A database system and methodology for generalized order optimization is described. In one embodiment, for example, in a database system, a method of the present invention is described for optimizing a query requesting data from a database in an ordered form, the method comprises steps of: generating a plurality of partial access plans for obtaining data requested by the query; constructing generalized orders representing requirements of the query for ordering of data, each generalized order representing a set of simple orders; creating generalized orders representing order properties of the partial access plans; intersecting the generalized orders representing requirements of the query for ordering of data with the generalized orders representing order properties of the partial access plans to determine partial access plans having favorable orderings; and building a query execution plan for obtaining and ordering the data requested by the query based, at least in part, on selecting partial access plans having favorable orderings.