# US 2022/0284004 A1 · Measuring and improving index quality in a distributed data system

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2022/0284004 A1
- Document ID: US20220284004A1
- Status: Published application
- Kind: A1
- Application number: 17/193,694
- Filed: 2021-03-05
- Published: 2022-09-08
- Earliest claimed: 2021-03-05
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Babatunde Micheal OKUTUBO
- Web page: https://patentgrep.com/patent/US20220284004A1

## CPC

- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F 16/951: Indexing; Web crawling techniques
- G06F 16/215: Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
- G06F 16/22: Indexing; Data structures therefor; Storage structures
- G06F 16/278: {Data partitioning, e.g. horizontal or vertical partitioning}
- G06F 16/28: Databases characterised by their database models, e.g. relational or object models
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments described herein are directed to measuring and improving an index quality of a distributed data system. For example, various quality metrics are determined on a per partition basis of the distributed data system. Each of the quality metrics are indicative of a quality of a particular property of a partition. The quality metrics are aggregated to generate an overall index quality score, which provides a measure of the performance of the index. The index quality score is utilized to automatically detect an inefficiency of the index and automatically determine that certain index maintenance actions should be automatically performed to improve the performance of the index. Each quality metric may also be individually analyzed to determine which database property is affecting the performance of the index the most.

## Claims

### Claim 1

A method, comprising:
receiving, from a first compute node via a network, a first quality metric for a first partition of a database table maintained by a distributed database system, the first quality metric indicative of a quality of a first property of the first partition;
receiving, from a second compute node via the network, a second quality metric for a second partition of the database table, the second quality metric indicative of a quality of a second property of the second partition;
generating a global quality metric that is indicative of the performance of an index of the distributed database system based at least on the first quality metric and the second quality metric;
detecting an inefficiency with respect to the index based on the global quality metric meeting a condition with respect to a predetermined threshold; and
in response to detecting the inefficiency, performing an action to alter a manner in which data is stored by the database table.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first quality metric comprises a number of rows of the first partition, wherein the second quality metric comprises a number of rows of the second partition, and wherein said generating the global quality metric comprises:
analyzing at least the first quality metric and the second quality metric to determine whether at least a distribution of the rows of the first partition and the rows of the second partition meets a condition with respect to a second predetermined threshold;
responsive to determining that at least the distribution of the rows of the first partition and the rows of the second partition meets the condition with respect to the second predetermined threshold, maintaining a partitioning key on which at least the first partition and the second partition is based; and
responsive to determining that at least the distribution of the rows of the first partition and the rows of the second partition does not meet the condition with respect to the second predetermined threshold, determining a different partitioning key for at least the first partition and the second partition.

### Claim 3 (depends on 2)

The method of claim 2, wherein said performing the action to alter the manner in which data is stored by the database table comprises partitioning the database table in accordance with the different partitioning key.

### Claim 4 (depends on 1)

The method of claim 1, wherein the first quality metric comprises a first data clustering quality metric that is based at least on a first overlap value that indicates a maximum number of data files of the first partition that include a row having a particular value of a particular clustering key of first multiple clustering keys, and
wherein the second quality metric comprises a second data clustering quality metric that is based at least on a second overlap value that indicates a maximum number of data files of the second partition that include a row having a particular value for a particular clustering key of second multiple clustering keys, and
wherein said generating the global quality metric comprises:
determining a greatest data clustering quality metric from among at least the first data clustering quality metric and the second data clustering quality metric;
in response to determining that the first data clustering quality metric is the greatest data clustering quality metric, designating the first data clustering quality metric as a global data clustering quality metric; and
in response to determining that the second data clustering quality metric is the greatest data clustering quality metric, designating the second data clustering quality metric as the global data clustering quality metric.

### Claim 5 (depends on 4)

The method of claim 4, wherein said performing the action to alter the manner in which data is stored by the database table comprises:
in response to determining that the first data clustering quality metric is the greatest data clustering quality metric, re-clustering at least a subset of the data files of the first partition that store rows having values for the first multiple clustering keys such that at least the subset of the data files of the first partition store rows having values for a single clustering key of the first multiple clustering keys; and
in response to determining that the second data clustering quality metric is the greatest data clustering quality metric, re-clustering at least a subset of the data files of the second partition that store rows having values for the second multiple clustering keys such that at least the subset of the data files of the second partition store rows having values for a single clustering key of the second multiple clustering keys.

### Claim 6 (depends on 1)

The method of claim 1, wherein the first quality metric comprises a first data packing quality metric that is based on a first average file quality of data files of the first partition, the first average file quality being based on a number of rows stored by each of the data files of the first partition and a predetermined ideal row count parameter;
wherein the second quality metric comprises a second data packing quality metric that is based on a second average file quality of data files of the second partition, the second average file quality being based on a number of rows stored by each of the data files of the second partition and the predetermined ideal row count parameter, and
wherein said generating the global quality metric comprises:
generating a global data packing quality metric based at least on the first data packing metric and the second data packing metric.

### Claim 7 (depends on 6)

The method of claim 6, wherein said performing the action to alter the manner in which data is stored by the database table comprises:
performing at least one of:
merging two or more data files of the data files of the first partition each having a number of rows that is less than the predetermined ideal row count parameter; or
merging two or more data files of the data files of the second partition each having a number of rows that is less than the predetermined ideal row count parameter.

### Claim 8 (depends on 1)

The method of claim 1, wherein the first quality metric comprises a first compaction quality metric that is based on a number of uncompressed rows maintained by data files of the first partition, and
wherein the second quality metric comprises a second compaction quality metric that is based on a number of uncompressed rows maintained by data files of the second partition, and
wherein said generating the global quality metric comprises:
generating a global compaction quality metric based at least on a combination of the first compaction quality metric and the second compaction quality metric and a predetermined compression threshold parameter.

### Claim 9 (depends on 8)

The method of claim 8, wherein said performing the action to alter the manner in which data is stored by the database table comprises:
performing at least one of:
compressing the uncompressed rows of the data files maintained by the first partition; or
compressing the uncompressed rows of the data files maintained by the second partition.

### Claim 10 (depends on 1)

The method of claim 1, wherein the first quality metric comprises a first fragmentation quality metric that is based on a number of rows that are marked for deletion in data files of the first partition, and
wherein the second quality metric comprises a second fragmentation quality metric that is based on a number of rows marked for deletion in data files of the second partition, and
wherein said generating the global quality metric comprises:
generating a global fragmentation quality metric based at least on a combination of the first fragmentation quality metric and the second fragmentation quality metric and a total number of rows in the first partition and the second partition.

### Claim 11 (depends on 10)

The method of claim 10, said performing the action to alter the manner in which data is stored by the database table comprises:
performing at least one of:
merging active rows of a first data file, that also comprises first rows marked for deletion, of the data files of the first partition with active rows of a second data file, that also comprises second rows marked for deletion, of the data files of the first partition into a first new data file, and
merging the first rows of the first data file that are marked for deletion with the second rows of the second data file that are marked for deletion into a second new data file; or
merging active rows of a third data file, that also comprises third rows marked for deletion, of the data files of the second partition with active rows of a fourth data file, that also comprises fourth rows marked for deletion, of the data files of the second partition into a third new data file, and
merging the third rows of the third data file that are marked for deletion with the fourth rows of the fourth data file that are marked for deletion into a fourth new data file.

### Claim 12

A system, comprising:
at least one processor circuit; and
at least one memory that stores program code configured to be executed by the at least one processor circuit, the program code comprising:
a quality aggregator configured to:
receive, from a first compute node via a network, a first quality metric for a first partition of a database table maintained by a distributed database system, the first quality metric indicative of a quality of a first property of the first partition;
receive, from a second compute node via the network, a second quality metric for a second partition of the database table, the second quality metric indicative of a quality of a second property of the second partition; and
generate a global quality metric that is indicative of the performance of an index of the distributed database system based at least on the first quality metric and the second quality metric; and
an index management system configured to:
detect an inefficiency with respect to the index based on the global quality metric meeting a condition with respect to a predetermined threshold; and
in response to detecting the inefficiency, perform an action to alter a manner in which data is stored by the database table.

### Claim 13 (depends on 12)

The system of claim 12, wherein the first quality metric comprises a number of rows of the first partition, wherein the second quality metric comprises a number of rows of the second partition, and wherein the quality aggregator is configured to generate the global quality metric by:
analyzing at least the first quality metric and the second quality metric to determine whether at least a distribution of the rows of the first partition and the rows of the second partition meets a condition with respect to a second predetermined threshold;
responsive to determining that at least the distribution of the rows of the first partition and the rows of the second partition meets the condition with respect to the second predetermined threshold, maintaining a partitioning key on which at least the first partition and the second partition is based; and
responsive to determining that at least the distribution of the rows of the first partition and the rows of the second partition does not meet the condition with respect to the second predetermined threshold, determining a different partitioning key for at least the first partition and the second partition.

### Claim 14 (depends on 13)

The system of claim 13, wherein the index management system is further configured to: partition the database table in accordance with the different partitioning key.

### Claim 15 (depends on 12)

The system of claim 12, wherein the first quality metric comprises a first data clustering quality metric that is based at least on a first overlap value that indicates a maximum number of data files of the first partition that include a row having a particular value of a particular clustering key of first multiple clustering keys, and
wherein the second quality metric comprises a second data clustering quality metric that is based at least on a second overlap value that indicates a maximum number of data files of the second partition that include a row having a particular value for a particular clustering key of second multiple clustering keys, and
wherein the quality aggregator is configured to generate the global quality metric by:
determining a greatest data clustering quality metric from among at least the first data clustering quality metric and the second data clustering quality metric;
in response to determining that the first data clustering quality metric is the greatest data clustering quality metric, designating the first data clustering quality metric as a global data clustering quality metric; and
in response to determining that the second data clustering quality metric is the greatest data clustering quality metric, designating the second data clustering quality metric as the global data clustering quality metric.

### Claim 16 (depends on 15)

The system of claim 15, wherein the index management system is further configured to:
in response to determining that the first data clustering quality metric is the greatest data clustering quality metric, re-cluster at least a subset of the data files of the first partition that store rows having values for the first multiple clustering keys such that at least the subset of the data files of the first partition store rows having values for a single clustering key of the first multiple clustering keys; and
in response to determining that the second data clustering quality metric is the greatest data clustering quality metric, re-cluster at least a subset of the data files of the second partition that store rows having values for the second multiple clustering keys such that at least the subset of the data files of the second partition store rows having values for a single clustering key of the second multiple clustering keys.

### Claim 17 (depends on 12)

The system of claim 12, wherein the first quality metric comprises a first data packing quality metric that is based on a first average file quality of data files of the first partition, the first average file quality being based on a number of rows stored by each of the data files of the first partition and a predetermined ideal row count parameter,
wherein the second quality metric comprises a second data packing quality metric that is based on a second average file quality of data files of the second partition, the second average file quality being based on a number of rows stored by each of the data files of the second partition and the predetermined ideal row count parameter, and
wherein the quality aggregator is configured to generate the global quality metric by:
generating a global data packing quality metric based at least on the first data packing metric and the second data packing metric.

### Claim 18 (depends on 17)

The system of claim 17, wherein the index management system is further configured to:
perform at least one of:
merge two or more data files of the data files of the first partition each having a number of rows that is less than the predetermined ideal row count parameter; or
merge two or more data files of the data files of the second partition each having a number of rows that is less than the predetermined ideal row count parameter.

### Claim 19 (depends on 12)

The system of claim 12, wherein the first quality metric comprises a first compaction quality metric that is based on a number of uncompressed rows maintained by data files of the first partition, and
wherein the second quality metric comprises a second compaction quality metric that is based on a number of uncompressed rows maintained by data files of the second partition, and
wherein the quality aggregator is configured to generate the global quality metric by:
generating a global compaction quality metric based at least on a combination of the first compaction quality metric and the second compaction quality metric and a predetermined compression threshold parameter.

### Claim 20

A computer-readable storage medium having program instructions recorded thereon that, when executed by at least one processor of a computing device, perform a method, the method comprising:
receiving, from a first compute node via a network, a first quality metric for a first partition of a database table maintained by a distributed database system, the first quality metric indicative of a quality of a first property of the first partition;
receiving, from a second compute node via the network, a second quality metric for a second partition of the database table, the second quality metric indicative of a quality of a second property of the second partition;
generating a global quality metric that is indicative of the performance of an index of the distributed database system based at least on the first quality metric and the second quality metric;
detecting an inefficiency with respect to the index based on the global quality metric meeting a condition with respect to a predetermined threshold; and
in response to detecting the inefficiency, performing an action to alter a manner in which data is stored by the database table.
