US11868353B1ActiveUtilityA1
Fingerprints for database queries
Est. expiryJul 7, 2042(~16 yrs left)· nominal 20-yr term from priority
G06F 16/24561G06F 11/3414G06F 16/2425G06F 16/242
84
PatentIndex Score
2
Cited by
12
References
20
Claims
Abstract
In some examples, a system identifies sub-portions of a database query, assigns identifiers to the identified sub-portions, and adds the identifiers to a data structure. The system generates a fingerprint representing the database query based on applying a fingerprint function on the data structure including the identifiers.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1. A non-transitory machine-readable storage medium comprising instructions that upon execution cause a system to:
receive a database query;
identify sub-portions of the database query, wherein the sub-portions comprise one or more of an expression in the database query and an operator in the database query;
assign identifiers to the identified sub-portions based on one of:
accessing mapping information that maps different sub-portions to respective sub-portion identifiers that uniquely identify the respective sub-portions; and
applying a function to the respective sub-portions, wherein an output value produced by the function comprises a unique identifier of a corresponding sub-portion;
add the identifiers to a data structure;
generate a fingerprint representing the database query based on applying a fingerprint function to the identifiers in the data structure; and
perform a management process based on the generated fingerprint, wherein the management process uniquely identifies the database query based on the fingerprint.
2. The non-transitory machine-readable storage medium of claim 1 , wherein the identifying of the sub-portions comprises identifying a first sub-portion and identifying further sub-portions of the first sub-portion, wherein the assigning of identifiers comprises assigning a first identifier to the first sub-portion and further identifiers to the further sub-portions, and
wherein the fingerprint is based on applying the fingerprint function on the data structure including the first identifier and the further identifiers.
3. The non-transitory machine-readable storage medium of claim 1 , wherein the identified sub-portions comprise an expression in the database query, and wherein the fingerprint is based on applying the fingerprint function on the data structure including an identifier of the expression.
4. The non-transitory machine-readable storage medium of claim 1 , wherein the identified sub-portions comprise an operator in the database query, and wherein the fingerprint is based on applying the fingerprint function on the data structure including an identifier of the operator.
5. The non-transitory machine-readable storage medium of claim 1 , wherein the identified sub-portions comprise a predicate in the database query, and wherein the fingerprint is based on applying the fingerprint function on the data structure including an identifier of the predicate.
6. The non-transitory machine-readable storage medium of claim 1 , wherein the identified sub-portions comprise a projection in the database query, and wherein the fingerprint is based on applying the fingerprint function on the data structure including an identifier of the projection.
7. The non-transitory machine-readable storage medium of claim 1 , wherein the identified sub-portions comprise a command in the database query, and wherein the fingerprint is based on applying the fingerprint function on the data structure including an identifier of the command.
8. The non-transitory machine-readable storage medium of claim 1 , wherein the identified sub-portions comprise an attribute in the database query, and wherein the fingerprint is based on applying the fingerprint function on the data structure including an identifier of the attribute.
9. The non-transitory machine-readable storage medium of claim 1 , wherein the identified sub-portions comprise a constant or a placeholder representing the constant, and wherein the fingerprint is based on applying the fingerprint function on the data structure including an identifier of the constant or the placeholder.
10. The non-transitory machine-readable storage medium of claim 1 , wherein the data structure has a variable length, and wherein the fingerprint function is to output a value of a fixed length as a fingerprint regardless of a length of the data structure.
11. The non-transitory machine-readable storage medium of claim 1 , wherein the identified sub-portions comprise Structured Query Language (SQL) elements.
12. The non-transitory machine-readable storage medium of claim 1 , wherein the instructions upon execution cause the system to:
parse the database query into the sub-portions; and
represent the sub-portions as nodes of a parse tree,
wherein the identifying of the sub-portions in the database query comprises identifying the sub-portions represented by the nodes of the parse tree.
13. The non-transitory machine-readable storage medium of claim 1 , wherein the management process comprises a workload management process to manage a workload including database operations responsive to database queries, and wherein the workload management process uniquely identifies database queries based on fingerprints generated for the database queries.
14. The non-transitory machine-readable storage medium of claim 1 , wherein the fingerprint function is based on one of:
a hash function;
a cryptographic hash function;
a checksum function;
a secure Hash Algorithm; and
a message-digest 5 function.
15. A system comprising:
a processor; and
a non-transitory storage medium storing instructions executable on the processor to:
receive a database query;
identify sub-portions of the database query, the identified sub-portions comprising a command, wherein the identified sub-portions further comprise one or more of an expression in the database query and an operator in the database query;
assign identifiers to the identified sub-portions comprising the command based on one of:
accessing mapping information that maps different sub-portions to respective sub-portion identifiers that uniquely identify the respective sub-portions; and
applying a function to the respective sub-portions, wherein an output value produced by the function comprises a unique identifier of a corresponding sub-portion;
add the identifiers to a data structure; and
generate a fingerprint representing the database query based on applying a fingerprint function to the identifiers in the data structure; and
perform a management process based on the generated fingerprint, wherein the management process uniquely identifies the database query based on the fingerprint.
16. The system of claim 15 , wherein the identified sub-portions further comprise a predicate, and the identifiers comprise an identifier assigned to the predicate.
17. The system of claim 15 , wherein the data structure has a variable length, and wherein the fingerprint function is to output a value of a fixed length as a fingerprint regardless of a length of the data structure.
18. The system of claim 15 , wherein the fingerprint function is based on one of:
a hash function;
a cryptographic hash function; and
a checksum function.
19. A method of a system comprising a hardware processor, comprising:
receiving a database query;
identifying sub-portions of the database query, wherein the sub-portions comprise one or more of an expression in the database query and an operator in the database query;
obtaining unique identifiers for the identified sub-portions based on one of:
accessing mapping information that maps different sub-portions to respective sub-portion identifiers that uniquely identify the respective sub-portions; and
applying a function to the respective sub-portions, wherein an output value produced by the function comprises a unique identifier of a corresponding sub-portion;
adding the unique identifiers for the identified sub-portions to a data structure;
generating a fingerprint representing the database query based on applying a fingerprint function to the identifiers in the data structure, the fingerprint function to produce a value of a fixed length as the fingerprint regardless of a length of the data structure; and
using, by a management process, the fingerprint to uniquely identify the database query.
20. The method of claim 19 , wherein a length of the data structure is dependent upon a quantity of the unique identifiers added in the data structure.Cited by (0)
No later patents cite this yet.
References (0)
No backward citations on record.