Object Index Determination via Query Inversion
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Efficiently determining the index of an object in a sequence of objects, especially when only a fragment of the query result sequence is of concern, is challenging due to the time-consuming nature of index movement and the inefficiency of existing methods in handling unique identifiers and ordering criteria.
Innovation Solution
Construct a reversed query (Q′) based on the original query (Q) to check if the object exists as the first item in the result set, utilizing the unique identifier and order criteria to determine the index by counting the results of the reversed query, which ensures that only the first element needs to be checked.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If the iterator/fragment is moved to a new index to access objects not available at current index, then the desired object can be accessed, but the operation is time-consuming and iteration over the whole sequence is not trivial
Solution Approach 1:
The patent applies inversion by constructing a reversed query Q' that orders results in the opposite direction of the original query Q. Instead of moving the iterator forward through the sequence to reach the target object, the system queries backward from the end of the sequence. The index is calculated as: index = total_count - count_of_results_from_reversed_query. This transforms a potentially time-consuming forward iteration into a efficient backward query with constant-time index calculation.
2Ease of operation
If nested records with previous/next references are used to access objects in sequence, then object access is simplified, but the references would have to be rebuilt with each ordering of the sequence which is inefficient
Solution Approach 1:
The patent changes the parameter of ordering by constructing a query with reversed ordering criteria. Instead of maintaining physical references that would need reconstruction, the system changes the query parameter (ORDER BY clause) to traverse the sequence in reverse. This allows logical navigation without physical reference updates, maintaining ease of access while improving reordering efficiency.
3Ease of operation
If the whole query result sequence is retrieved at once, then all objects are available for access, but transmission and storage performance deteriorate
Solution Approach 1:
The patent extracts only the necessary information (total count and results from the reversed query) rather than retrieving the entire sequence. By using the reversed query approach, the system obtains the index information and relevant objects without loading the complete result set into memory, thus reducing transmission and storage energy consumption while maintaining access convenience.
Data Source
AI summary
A method for determining an index of an object in a sequence of objects, the method comprising the steps of: obtaining a unique identifier value of a given object O; obtaining a query definition Q of a sequence, the Q query including an order definition according to a parameter of the O object; constructing a Q′ query based on the Q query, the Q′ query being different from the Q query by having a reversed ordering of results, with respect to the Q query, and providing results having said parameter value of objects preceding or matching the parameter value of the object O in the sequence of objects in the Q query result set; executing the Q′ query by a query execution engine; checking whether the object O is present as the first item in Q′ result set and in case it is, obtaining the index of the O object in Q sequence by retrieving objects count of the Q′ result set.


