Indexing and searching numeric ranges
AssigneeMicrosoft Corporation
InventorsGaurav Sareen, Michael A. Isard
Life of this patent
Estimating the term…
Abstract
Index entries representing ranges of values are queried with a query value to determine if the query value is in one of the ranges. Numeric ranges are represented in an index and queries are constructed to match index entries. Search terms are constructed from the query value, such that a search term matches an index entry if and only if the queried for valued is in the range represented by the index entry. To facilitate querying the indexes, queries are constructed to contain search terms having a data structure format similar to that of the index entries.
Claims14
A processor-implemented method for searching a range of numeric values, said method comprising:
- providing an index entry data structure comprising:
- a first portion to indicate that said index entry comprises a predetermined minimum value and maximum value that represents a range of numeric values, wherein said minimum value is different than said maximum value;
- and
- a second portion comprising a non-variable portion having a fixed value and a variable portion comprising said range of numeric values;
- populating, via the processor, an index with a set of index entries comprising the minimum number of index entries necessary to include all index entries within the predetermined range of numerical values, wherein a value representable by the range corresponds to only one entry in the index;
- providing a plurality of search terms indicative of a query value;
- comparing, via the processor, each of said index entries with each of said search terms;
- if said act of comparing results in a match between said index entry and a search term, providing, in each index entry, an indication of a respective portion of said range of numeric values associated with said matching index entry;
- formatting said query value, wherein said formatted query value comprises a number of digit positions;
- determining a number of search terms in said plurality of search terms to be equal to one plus said number of formatted query value digit positions;
- constructing a first search term of said plurality of search terms by placing a don't care indicator in each digit position of said first search term, wherein said don't care indicator indicates that any value can be placed at said digit position;
- constructing each subsequent search term of said plurality of search terms by:
- replicating a previously constructed search term;
- and
- replacing a don't care indicator with a digit value in a corresponding digit position of said formatted query value.
A computer-readable storage medium having stored thereon an index entry data structure, comprising:
- a first portion indicative of said index entry being indicative of a range of values, wherein the minimum value and maximum value of said range of values are different;
- a second portion indicative of said range of values, said second portion comprising:
- a first part indicative of a predetermined value and a second part indicative of a range of values;
- a populated index with a set of index entries comprising a minimum number of index entries that includes an entire range of numerical values, in which each index entry provides an indication of a respective portion of said range of values associated with the index entry, wherein a value representable by the range corresponds to only one entry in the index;
- a data structure of a formatted query value comprises a number of digit positions, wherein each digit position comprises a digit value;
- a data structure of a first search term of said plurality of search terms comprises a don't care indicator in each digit position of said first search term, wherein said don't care indicator indicates that any value can be placed at said digit position;
- and
- a data structure for each subsequent search term of said plurality of search terms comprises:
- a replica of a previously constructed search term with a don't care indicator replaced with a digit value in a corresponding digit position of said formatted query value.
A system for indexing a range of numeric values, said system comprising:
- a memory portion for:
- storing an index entry data structure comprising:
- a first portion to indicate that said index entry comprises a predetermined minimum value and maximum value that represents a range of numeric values, where said minimum value is different than said maximum value;
- and
- a second portion comprising:
- a non-variable portion having a fixed value and a variable portion comprising said range of numeric values;
- and
- storing a plurality of search terms indicative of a query value;
- a processor portion configured to:
- populate an index with a set of index entries comprising the minimum number of index entries necessary to include all index entries within the predetermined range of numerical values, wherein a value representable by the range corresponds to only one entry in the index;
- compare each of said index entry with each of said search terms;
- and
- format said query value, wherein said formatted query value comprises a number of digit positions;
- determine a number of search terms in said plurality of search terms to be equal to one plus said number of formatted query value digit positions;
- construct a first search term of said plurality of search terms by placing a don't care indicator in each digit position of said first search term, wherein said don't care indicator indicates that any value can be placed at said digit position;
- and
- construct each subsequent search term of said plurality of search terms by:
- replicating a previously constructed search term;
- and
- replacing a don't care indicator with a digit value in a corresponding digit position of said formatted query value
- an input/output portion for:
- providing, in each index entry, an indication of a respective portion of said range of numeric values associated with said matching index entry, if said comparison results in a match between said index entry and a search term.
A processor-implemented method for creating a set of numeric index values covering a range of values to be indexed, said method comprising:
- providing an index entry data structure comprising:
- a first portion to indicate that said index entry comprises a predetermined minimum value and maximum value that represents a range of numeric values, wherein said minimum value is different than said maximum value;
- and
- a second portion comprising:
- a non-variable portion having a fixed value;
- and
- a variable portion comprising said range of numeric values;
- populating, via the processor, an index with a set of index entries comprising the minimum number of index entries necessary to include all index entries within the predetermined range of numerical values, wherein a value representable by the range corresponds to only one entry in the index;
- formatting said query value, wherein said formatted query value comprises a number of digit positions;
- determining a number of search terms in said plurality of search terms to be equal to one plus said number of formatted query value digit positions;
- constructing a first search term of said plurality of search terms by placing a don't care indicator in each digit position of said first search term, wherein said don't care indicator indicates that any value can be placed at said digit position;
- constructing each subsequent search term of said plurality of search terms by:
- replicating a previously constructed search term;
- and
- replacing a don't care indicator with a digit value in a corresponding digit position of said formatted query value;
- providing a plurality of search terms indicative of a query value;
- comparing each of said index entries with each of said search terms;
- and
- if said act of comparing results in a match between said index entry and a search term, providing, in each index entry, an indication of a respective portion of said range of numeric values associated with said matching index entry.
Dependencies are inferred from the claim text.