System and method for analysis of a database proxy
First Claim
Patent Images
1. A method for analyzing join operations in a database proxy, the method comprising:
- identifying a set of N relevant shard tables referenced in a query, the query received by the proxy, wherein N>
1;
representing the referenced shard tables as vertices of a graph having N vertices {S0, . . . SN-1}, each of the vertices representing a corresponding one of the referenced shard tables, SKi being a key based upon which the shard table represented by Si is distributed across shards, and SKj being a key based upon which the shard table represented by Sj is distributed across shards;
for each pair of vertices Si and Sj for (0<
=i<
=N−
1) and (0<
=j<
=N−
1) and i≠
j, inserting into the graph an edge connecting vertices Si and Sj if and only if (a) SKi is the same key as SKj and (b) SKi and SKj are defined to have matching values or value ranges;
if and only if the graph contains a path comprising one or more edges from each vertex on the graph to all other vertices on the graph, determining the query will not cause a shard conflict, andupon determining the query will not cause a shard conflict, consulting a distribution table to identify a shard storing the referenced shard tables; and
executing the query on the shard.
1 Assignment
0 Petitions
Accused Products
Abstract
A system and method for processing a database query may include determining a set of tables referenced in a query; representing the set of tables by vertices of a graph; and, if the graph is incomplete, then determining the query is associated with a shard conflict. A system and method may determine a query is not associated with a shard conflict if, and only if, the graph is complete.
45 Citations
10 Claims
-
1. A method for analyzing join operations in a database proxy, the method comprising:
-
identifying a set of N relevant shard tables referenced in a query, the query received by the proxy, wherein N>
1;representing the referenced shard tables as vertices of a graph having N vertices {S0, . . . SN-1}, each of the vertices representing a corresponding one of the referenced shard tables, SKi being a key based upon which the shard table represented by Si is distributed across shards, and SKj being a key based upon which the shard table represented by Sj is distributed across shards; for each pair of vertices Si and Sj for (0<
=i<
=N−
1) and (0<
=j<
=N−
1) and i≠
j, inserting into the graph an edge connecting vertices Si and Sj if and only if (a) SKi is the same key as SKj and (b) SKi and SKj are defined to have matching values or value ranges;if and only if the graph contains a path comprising one or more edges from each vertex on the graph to all other vertices on the graph, determining the query will not cause a shard conflict, and upon determining the query will not cause a shard conflict, consulting a distribution table to identify a shard storing the referenced shard tables; and executing the query on the shard. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A system comprising:
-
a memory; and a controller, the controller configured to; identify N referenced shard tables referenced in a query received by the proxy, where N>
1;representing the referenced shard tables as vertices of a graph having N vertices {S0, . . . SN-1}, each of the vertices representing a corresponding one of the referenced shard tables, SKi being a key based upon which the shard table represented by Si is distributed across shards, and SKj being a key based upon which the shard table represented by Sj is distributed across shards; for each pair of vertices Si and Sj for (0<
=i<
=N−
1) and (0<
=j<
=N−
1) and i≠
j, inserting into the graph an edge connecting vertices Si and Sj if and only if (a) SKi is the same key as SKj and (b) SKi and SKj are defined to have matching values or value ranges;if and only if the graph contains a path comprising one or more edges from each vertex on the graph to all other vertices on the graph, determined the query will not cause a shard conflict; consult a distribution table to identify a shard storing the reference shard tables upon determination that the query will not cause a shard conflict; and executing the query on the shard. - View Dependent Claims (7, 8, 9, 10)
-
Specification