Database system with read-consistent queries and methods for use therewith
A database system operates by: generating first segment addendum data indicating at least one addendum part indicating at least one change to a first segment of a plurality of segments, updating segment part activation data to indicate a first ownership sequence number (OSN) range for activation of the first segment addendum data during query execution, executing a first query, having a first ownership sequence number, based on accessing the first segment in response to first data ownership information tagged with the first ownership sequence number indicating activation of the first segment, and further based on foregoing applying of the at least one addendum part for the first segment in response to the first ownership sequence number falling outside of the first OSN range indicated in the segment part activation data for the first segment addendum data, and executing a second query, having a second ownership sequence number, based on accessing the first segment in response to second data ownership information tagged with the first ownership sequence number indicating activation of the first segment.
1 . A storage sub-system of a database system, wherein the storage sub-system comprises:
a plurality of computing device cluster wherein a computing device cluster of the plurality of computing device clusters includes a plurality of computing devices, wherein a computing device of the plurality of computing devices includes a plurality of computing nodes, wherein a set of computing devices of the computing device cluster is operable to, over time:
store a plurality of segment groups, wherein a first set of segment groups of the plurality of segment groups is regarding a first dataset, wherein a second set of segment groups of the plurality of segment groups is regarding a second dataset, wherein the first dataset includes a first plurality of rows of columnar data, wherein columnar data includes a plurality of columns of data, and wherein a first segment of the first set of segment groups includes a first set of rows of columnar data of the first plurality of rows;
detect changes to segments of the plurality of segment groups;
record the changes to the segments in an addendum file;
at a first time within the over time:
generate a first state of first currently stored segment groups of the plurality of segment groups and of a first current version of the addendum file; and
assign a first owner sequence number to the first state;
at a second time within the over time, wherein the second time is subsequent to the first time:
generate a second state of second currently stored segment groups of the plurality of segment groups and of a second current version of the addendum file; and
assign a second owner sequence number to the second state.
2 . The storage sub-system of claim 1 , wherein the set of computing devices is further operable to:
receive the first set of segment groups prior to the first time; and
receive a second set of segment groups of the plurality of segment groups after the first time and prior to the second time, wherein the first state includes the first set of segment groups but does not include the second set of segment groups, and the second state includes the first and second sets of segment groups.
3 . The storage sub-system of claim 1 , wherein the set of computing devices is further operable to detect the changes by one or more of:
detect a new index regarding a segment of the first set of segment groups;
detect a new column being added to a segment of the first set of segment groups;
detect a new row being added to a segment of the first set of segment groups;
detect deletion of a row from a segment of the first set of segment groups;
detect rebuilding of a segment of the first set of segment groups; and
detect a new segment being added to the first set of segment groups.
4 . The storage sub-system of claim 1 , wherein the set of computing devices is further operable to record the changes by:
recording a change to the first segment in a first addendum file;
recording a change to a second segment of the first set of segment groups in a second addendum file; and
recording a change to a third segment of the first set of segment groups in a third addendum file.
5 . The storage sub-system of claim 1 , wherein the set of computing devices is further operable to:
store original segments of the first set of segment groups in an original segment memory section of the set of computing devices; and
store the changes to the original segments of the first set of segment groups in the addendum file in an addendum memory section of the set of computing device.
6 . The storage sub-system of claim 1 , wherein the set of computing devices is further operable to:
store original segments of the first set of segment groups in an original segment memory section of the set of computing devices;
from time of original storage to an update time with the over time, store the changes to the original segments of the first set of segment groups in the addendum file in an addendum memory section of the set of computing device;
at the update time:
update the original segments of the first set of segment to include the changes per the addendum file to produce updated segments;
store the updated segments in the original segment memory section of the set of computing devices; and
create a new addendum file for recording changes to the updated segments that occur after the update time.
7 . The storage sub-system of claim 1 , wherein the set of computing devices is further operable to:
receive a query regarding the first dataset;
determine the owner sequence number for the first database based on the query;
identify segments of the first dataset and changes thereto based on the owner sequence number to produce time-appropriate segments of the first dataset for execution in accordance with the query.
8 . The storage sub-system of claim 1 further comprises one or more of:
the set of computing devices set includes one or more computing devices;
the first set of segment groups includes one or more segment groups;
the second set of segment groups includes one or more segment groups; and
the first set of rows of columnar data includes a plurality of rows.
9 . A computer readable memory device that comprises:
a first memory that stores operational instructions that, when executed by a set of computing devices of a computing device cluster of a plurality of computing device clusters of a storage sub-system of a database system, cause the set of computing devices to, over time:
store a plurality of segment groups, wherein a first set of segment groups of the plurality of segment groups is regarding a first dataset, wherein a second set of segment groups of the plurality of segment groups is regarding a second dataset, wherein the first dataset includes a first plurality of rows of columnar data, wherein columnar data includes a plurality of columns of data, and wherein a first segment of the first set of segment groups includes a first set of rows of columnar data of the first plurality of rows;
detect changes to segments of the plurality of segment groups;
record the changes to the segments in an addendum file;
at a first time within the over time:
generate a first state of first currently stored segment groups of the plurality of segment groups and of a first current version of the addendum file; and
assign a first owner sequence number to the first state;
at a second time within the over time, wherein the second time is subsequent to the first time:
generate a second state of second currently stored segment groups of the plurality of segment groups and of a second current version of the addendum file; and
assign a second owner sequence number to the second state.
10 . The computer readable memory device of claim 9 , wherein the first memory further stores operational instructions that, when executed by the set of computing devices, cause the set of computing devices to:
receive the first set of segment groups prior to the first time; and
receive a second set of segment groups after the first time and prior to the second time,
wherein the first state includes the first set of segment groups but not the second set of segment groups, and the second state includes both the first and second sets of segment groups.
11 . The computer readable memory device of claim 9 , wherein the first memory further stores operational instructions that, when executed by the set of computing devices, cause the set of computing devices to:
detect one or more of:
a new index regarding a segment;
a new column added to a segment;
a new row added to a segment;
deletion of a row from a segment;
rebuilding of a segment; and
a new segment added to a segment group.
12 . The computer readable memory device of claim 9 , wherein the operational instructions further cause the set of computing devices to:
record a change to a first segment in a first addendum file;
record a change to a second segment in a second addendum file; and
record a change to a third segment in a third addendum file.
13 . The computer readable memory device of claim 9 , wherein the operational instructions further cause the set of computing devices to:
store original segments in an original segment memory section; and
store changes to the original segments in the addendum file in an addendum memory section.
14 . The computer readable memory device of claim 9 , wherein the operational instructions further cause the set of computing devices to:
from time of original storage to an update time, store changes in the addendum file;
at the update time:
apply the changes per the addendum file to produce updated segments;
store the updated segments in the original segment memory section; and
create a new addendum file for recording changes occurring after the update time.
15 . The computer readable memory device of claim 9 , further comprising a second memory that stores operational instructions that, when executed by the set of computing devices, cause the set of computing devices to:
receive a query regarding the first dataset;
determine an owner sequence number for the query;
identify segments of the first dataset and changes thereto based on the owner sequence number to produce time-appropriate segments of the first dataset for execution in accordance with the query.