Nearest Match Index Traversal for Database Query Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current database systems are inefficient when retrieving a single row with a value nearest to a target value, as they often require full table scans or multiple queries, which are cumbersome and performance-intensive, especially when the data distribution is unknown.

Innovation Solution

A new operator, 'NEAREST TO,' is defined to find rows in a table whose values are nearest to a target value by traversing an index once, allowing for efficient retrieval of rows or a set of rows with key values closest to the target value, even if the search column is not an index key, thereby reducing the need for full table scans and multiple queries.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If a full table scan is performed to find the nearest match, then all rows are examined ensuring the correct result is found, but the data retrieval time and computational resources increase significantly

Engineering Contradiction:
Improveaccuracy of nearest matchVSAvoiddata retrieval time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent segments the search space by utilizing existing database indexes. Instead of scanning the entire table, the query is divided into multiple index range scans that cover different portions of the data. Each index range scan operates on a segmented portion of the table defined by index key ranges, allowing the system to find nearest matches efficiently without examining all rows.

Inventive Principle:
Principle #1Segmentation

2Measurement precision

If multiple separate queries are executed to find nearest matches above and below a target value, then the nearest match can be found, but the query complexity and number of index accesses increase

Engineering Contradiction:
Improveaccuracy of nearest matchVSAvoidquery complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent merges multiple search operations into a single unified index range scan. Instead of executing separate queries to find values above and below the target, the system combines these operations by performing one index range scan that retrieves candidate rows from both directions. The ordering by distance metric then combines the results, eliminating the need for multiple separate index accesses and reducing query complexity.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent creates a universal query mechanism that handles both finding values greater than and less than the target within a single operation. The index range scan is designed to be multi-functional, capable of retrieving candidates from both sides of the target value simultaneously, and the distance-based ordering provides a universal method for identifying the nearest match regardless of direction.

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

3Productivity

If an index is created on the search column to speed up retrieval, then query performance improves, but the index maintenance overhead and storage requirements increase

Engineering Contradiction:
Improvedata retrieval speedVSAvoidstorage requirements
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The patent applies partial action by utilizing existing indexes that may already exist on the table for other purposes. Instead of always creating new indexes on search columns, the system leverages available indexes when possible, performing index range scans on existing index structures. This approach provides speedup without incurring the full overhead of creating and maintaining new indexes, reducing storage requirements while still improving retrieval performance.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS8452757B2Index mechanism for finding nearest matches in a computer system
Publication Date: 2013.05.28 ORACLE INT CORP
  • US8452757B2 patent drawing
  • US8452757B2 patent drawing
  • US8452757B2 patent drawing

AI summary

A technique for finding the nearest match in a computer storage system is provided. A query statement includes a new operator that indicates that a user desires to access a set of rows that contain a value nearest to a target value. An index is accessed that is based at least in part on a column reference included in the statement. The index comprises a plurality of leaf nodes, where each leaf node comprises one or more entries, where each entry contains a key value, corresponding to the column reference, and a reference to a row in a table. Because leaf nodes in an index are ordered and linked to one another, a portion of the index need only be scanned once. The set of rows from the table are returned that are referenced by one or more entries whose column values are nearest to the target value.