CPC G06F 16/27 (2019.01) [G06F 16/2282 (2019.01); G06F 16/2471 (2019.01); G06F 16/278 (2019.01)] | 30 Claims |
1. A method comprising:
partitioning, into a plurality of affinity groups, a database table that is persistently stored on particular memory;
wherein partitioning the database table into the plurality of affinity groups is based on an affinity group key that corresponds to values in one or more columns of the database table;
wherein the database table includes a first portion assigned to a first affinity group, of the plurality of affinity groups, and a second portion assigned to a second affinity group, of the plurality of affinity groups;
wherein the database table is managed by a multi-node database management system (DBMS) that comprises a plurality of nodes;
wherein each node of the plurality of nodes executes a database server instance;
wherein the database server instance on each node of the plurality of nodes has shared access to the database table on the particular memory;
for each affinity group of the plurality of affinity groups, assigning a particular node of the plurality of nodes as a master node of said each affinity group;
wherein the master node of said each affinity group is responsible for managing locks for data, of the database table, that belong to said each affinity group;
wherein the step of assigning includes assigning the first affinity group to a first master node, of the plurality of nodes, and assigning the second affinity group to a second master node of the plurality of nodes;
sending, to a query router that is separate from and executing remotely relative to the plurality of nodes, a mapping indicating the master node for each affinity group of the plurality of affinity groups;
storing the mapping by the query router;
based on content of a particular query that requires data from the database table, determining whether the particular query should be routed using the mapping;
responsive to determining that the particular query should be routed using the mapping, the query router selecting a target node from the plurality of nodes, for the particular query, based on:
which portion of the database table is accessed by the particular query, and the mapping; and
sending the particular query to the target node to cause the database server instance on the target node to process the particular query.
|