Method and system for updating value correlation optimizations
First Claim
1. A method for executing database queries, the database comprising a first table (T1) having a primary key (PK) column and a first correlated value column (CV1) and a second table (T2) having a foreign key (FK) column related to the primary key column of the first table and a second correlated value column (CV2), comprising the steps of:
- preparing a database query for execution based at least in part on application of a derived constraint rule (DCR) having the following form;
(PK=FK)→
CV2+C1≦
CV1≦
CV2+C2 where C1 and C2 are constants, and “
→
”
means “
implies,”
to produce an execution plan;
including abort steps conditioned on changes in the DCR in the execution plan; and
executing the plan.
2 Assignments
0 Petitions
Accused Products
Abstract
A method, computer program, and database system are disclosed for executing database queries. The database includes a first table (T1) having a primary key (PK) column and a first correlated value column (CV1) and a second table (T2) having a foreign key (FK) column related to the primary key column of the first table and a second correlated value column (CV2). One implementation of the method includes preparing a database query for execution based at least in part on application of a derived constraint rule (DCR) having the form, (PK=FK)→CV2+C1≦CV1≦CV2+C2, where C1 and C2 are constants and “→” means “implies,” to produce an execution plan. Abort steps that are conditioned on changes in the DCR are also included in the execution plan. The plan is then executed.
-
Citations
18 Claims
-
1. A method for executing database queries, the database comprising a first table (T1) having a primary key (PK) column and a first correlated value column (CV1) and a second table (T2) having a foreign key (FK) column related to the primary key column of the first table and a second correlated value column (CV2), comprising the steps of:
-
preparing a database query for execution based at least in part on application of a derived constraint rule (DCR) having the following form;
(PK=FK)→
CV2+C1≦
CV1≦
CV2+C2where C1 and C2 are constants, and “
→
”
means “
implies,”
to produce an execution plan;including abort steps conditioned on changes in the DCR in the execution plan; and executing the plan. - View Dependent Claims (2, 3)
-
-
4. A method for executing database queries, the database comprising a first table (T1) having a primary key (PK) column and a first correlated value column (CV1) and a second table (T2) having a foreign key (FK) column related to the primary key column of the first table and a second correlated value column (CV2), comprising the steps of:
-
preparing a database query for execution based at least in part on application of a derived constraint rule (DCR) having the following form;
(PK=FK)→
CV2+C1≦
CV1≦
CV2+C2where C1 and C2 are constants, and “
→
”
means “
implies,”
to produce an execution plan that includes one or more DCR dependent steps;including update steps conditioned on changes in the DCR in the execution plan, the update steps modifying the DCR dependent steps based at least in part on those changes; and executing the plan. - View Dependent Claims (5, 6, 7)
-
-
8. A method for executing database queries, the database comprising a first table (T1) having a primary key (PK) column and a first correlated value column (CV1) and a second table (T2) having a foreign key (FK) column related to the primary key column of the first table and a second correlated value column (CV2), comprising the steps of:
-
storing a derived constraint rule (DCR) having the following form;
(PK=FK)→
CV2+C1≦
CV1≦
C2+C2where C1 and C2 are constants, and “
→
”
means “
implies,”
in a database system dictionary;placing a read lock on the stored DCR; after placing the read lock, preparing a database query for execution based at least in part on application of the DCR to produce an execution plan; and executing the plan.
-
-
9. A computer program, stored on a computer-readable storage medium, for executing database queries, the database comprising a first table (T1) having a primary key (PK) column and a first correlated value column (CV1) and a second table (T2) having a foreign key (FK) column related to the primary key column of the first table and a second correlated value column (CV2), the program comprising executable instructions that cause one or more computers to:
-
prepare a database query for execution based at least in part on application of a derived constraint rule (DCR) having the following form;
(PK=FK)→
CV2+C1≦
CV1≦
CV2+C2where C1 and C2 are constants, and “
→
”
means “
implies,”
to produce an execution plan;include abort steps conditioned on changes in the DCR in the execution plan; and execute the plan. - View Dependent Claims (10, 11)
-
-
12. A computer program, stored on a computer-readable storage medium, for executing database queries, the database comprising a first table (T1) having a primary key (PK) column and a first correlated value column (CV1) and a second table (T2) having a foreign key (FK) column related to the primary key column of the first table and a second correlated value column (CV2), the program comprising executable instructions that cause one or more computers to:
-
prepare a database query for execution based at least in part on application of a derived constraint rule (DCR) having the following form;
(PK=FK)→
CV2+C1≦
CV1≦
CV2+C2where C1 and C2 are constants, and “
→
”
means “
implies,”
to produce an execution plan that includes one or more DCR dependent steps;include update steps conditioned on changes in the DCR in the execution plan, the update steps modifying the DCR dependent steps based at least in part on those changes; and execute the plan.
-
-
13. A database system for executing database queries, comprising:
-
one or more nodes; a plurality of CPUs, each of the one or more nodes providing access to one or more CPUs; a plurality of virtual processes, each of the one or more CPUs providing access to one or more virtual processes; each virtual process configured to manage data, including rows organized in tables, stored in one of a plurality of data-storage facilities; a first table (T1) having a primary key (PK) column and a first correlated value column (CV1); a second table (T2) having a foreign key (FK) column related to the primary key column of the first table and a second correlated value column (CV2), and an optimizer configured to; prepare a database query for execution based at least in part on application of a derived constraint rule (DCR) having the following form;
(PK=FK)→
CV2+C1≦
CV1≦
CV2+C2where C1 and C2 are constants, and “
→
”
means “
implies,”
to produce an execution plan that includes one or more DCR dependent steps; andinclude update steps conditioned on changes in the DCR in the execution plan, the update steps modifying the DCR dependent steps based at least in part on those changes.
-
-
14. A database system for executing database queries, comprising:
-
one or more nodes; a plurality of CPUs, each of the one or more nodes providing access to one or more CPUs; a plurality of virtual processes, each of the one or more CPUs providing access to one or more virtual processes; each virtual process configured to manage data, including rows organized in tables, stored in one of a plurality of data-storage facilities; a first table (T1) having a primary key (PK) column and a first correlated value column (CV1); a second table (T2) having a foreign key (FK) column related to the primary key column of the first table and a second correlated value column (CV2), and an optimizer configured to; prepare a database query for execution based at least in part on application of a derived constraint rule (DCR) having the following form;
(PK=FK)→
CV2+C1≦
CV1≦
CV2+C2where C1 and C2 are constants, and “
→
”
means “
implies,”
to produce an execution plan; andinclude abort steps conditioned on changes in the DCR in the execution plan. - View Dependent Claims (15, 16)
-
-
17. A computer program, stored on a computer-readable storage medium, for executing database queries, the database comprising a first table (T1) having a primary key (PK) column and a first correlated value column (CV1) and a second table (T2) having a foreign key (FK) column related to the primary key column of the first table and a second correlated value column (CV2), the program comprising executable instructions that cause one or more computers to:
-
store a derived constraint rule (DCR) having the following form;
(PK=FK)→
CV2+C1≦
CV1≦
CV2+C2where C1 and C2 are constants, and “
→
”
means “
implies,”
in a database system dictionary;place a read lock on the stored DCR; after placing the read lock, prepare a database query for execution based at least in part on application of the DCR to produce an execution plan; and execute the plan.
-
-
18. A database system for executing database queries, comprising:
-
one or more nodes; a plurality of CPUs, each of the one or more nodes providing access to one or more CPUs; a plurality of virtual processes, each of the one or more CPUs providing access to one or more virtual processes; each virtual process configured to manage data, including rows organized in tables, stored in one of a plurality of data-storage facilities; a first table (T1) having a primary key (PK) column and a first correlated value column (CV1); a second table (T2) having a foreign key (FK) column related to the primary key column of the first table and a second correlated value column (CV2), and an optimizer configured to; store a derived constraint rule (DCR) having the following form;
(PK=FK)→
CV2+C1≦
CV1≦
CV2+C2where C1 and C2 are constants, and “
→
”
means “
implies,”
in a database system dictionary;place a read lock on the stored DCR; and after placing the read lock, prepare a database query for execution based at least in part on application of the DCR to produce an execution plan.
-
Specification