Database table column annotation
AssigneeHewlett-Packard Development Company, L.P.
InventorsHoa Binh Nga Tran, Lakshmikant Shrinivas, Kanti Marita Mann
Life of this patent
Estimating the term…
Abstract
According to an example, database constraint generation may include receiving data related to a table in a database, analyzing the data to determine a row count for a column of the table, and analyzing the data to determine a number of distinct values for the column of the table. A comparison value may be determined by comparing the row count to the number of distinct values. The database constraint generation may further include determining if the comparison value is within a threshold. If the comparison value is within the threshold, an annotation may be added to the column of the table such that the column is considered unique during a cardinality estimation process involving the table.
Claims15
A method for database constraint generation, the method comprising:
- receiving data related to a table in a database;
- analyzing the data to determine a row count for a column of the table;
- analyzing the data to determine a number of distinct values for the column of the table;
- determining a comparison value by comparing the row count to the number of distinct values;
- determining if the comparison value is within a threshold;
- and
- if the comparison value is within the threshold, adding, by a processor, an annotation to the column of the table such that the column is considered unique during a cardinality estimation process involving the table.
A database constraint generation apparatus comprising:
- a memory storing machine-readable instructions to:
- receive data related to a table in a database;
- analyze the data to determine a row count for a column of the table;
- analyze the data to determine a number of distinct values for the column of the table;
- determine a comparison value by comparing the row count to the number of distinct values;
- determine if the comparison value is within a threshold;
- and
- if the comparison value is within the threshold, add an annotation to the column of the table to restrict enforcement of a unique property of the column upon data insertions or updates to the column;
- and
- a processor to implement the machine-readable instructions.
A non-transitory computer readable medium having stored thereon machine-readable instructions to provide database constraint generation, the machine-readable instructions, when executed, cause a computer system to:
- receive data related to a table in a database;
- analyze the data to determine a row count for a column of the table;
- analyze the data to determine a number of distinct values for the column of the table;
- determine a comparison value by comparing the row count to the number of distinct values;
- determine if the comparison value is within a threshold;
- and
- if the comparison value is within the threshold, add, by a processor, an annotation to the column of the table to:
- restrict enforcement of a unique property of the column upon data insertions or updates to the column, and
- consider the column unique during a cardinality estimation process involving the table.
Dependencies are inferred from the claim text.