Materializing expressions within in-memory virtual column units to accelerate analytic queries
First Claim
1. A method comprising:
- storing, in volatile or non-volatile memory, a set of one or more column units;
wherein the set of one or more column units correspond to one or more columns;
wherein each column unit of the set of one or more column units includes data items from the column to which the column unit corresponds;
wherein the one or more columns belong to one or more on-disk tables within a database managed by a database server instance;
wherein the set of one or more column units includes a particular column unit that corresponds to at least one particular column of a particular table within the database;
storing, in volatile or non-volatile memory, a set of one or more virtual column units;
wherein the set of one or more virtual column units includes a particular virtual column unit that stores results that are derived by evaluating an expression on the at least one particular column;
storing, in volatile or non-volatile memory, data that associates the set of one or more column units with the set of one or more virtual column units;
wherein the set of one or more column units belong to a first in-memory columnar unit;
wherein the set of one or more virtual column units belong to a first in-memory expression unit;
wherein the first in-memory columnar unit and the first in-memory expression unit correspond to a first set of rows from the one or more columns;
wherein the results stored in the particular virtual column unit are derived using values in the first set of rows from the at least one particular column;
wherein the first set of rows include a first row and a second row;
maintaining, within a shared metadata unit, data that indicates which rows in the first set of rows have become stale within both the first in-memory columnar unit and the first in-memory expression unitstoring, in volatile or non-volatile memory, data that associates the shared metadata unit with the first in-memory columnar unit and the first in-memory expression unit;
in response to detecting an update to the first row, updating the data in the shared metadata unit to indicate that, within both the first in-memory columnar unit and the first in-memory expression unit, the first row has become stale;
after updating the data in the shared metadata unit, receiving a query that requires evaluation of the expression;
in response to receiving the query;
based on the data in the shared metadata unit, determining that, within the first in-memory columnar unit and the first in-memory expression unit, the first row has become stale;
responsive to determining that, within the first in-memory columnar unit and the first in-memory expression unit, the first row has become stale, evaluating the expression for the first row based on values obtained from a source other than the first in-memory columnar unit and the first in-memory expression unit;
based on the data in the shared metadata unit, determining that, within the first in-memory columnar unit and the first in-memory expression unit, the second row is not stale; and
responsive to determining that, within the first in-memory columnar unit and the first in-memory expression unit, the second row is not stale, obtaining results of the expression for the second row by reading cached results of the expression, for the second row, from the first in-memory expression unit.
1 Assignment
0 Petitions
Accused Products
Abstract
Techniques are described for materializing pre-computed results of expressions. In an embodiment, a set of one or more column units are stored in volatile or non-volatile memory. Each column unit corresponds to a column that belongs to an on-disk table within a database managed by a database server instance and includes data items from the corresponding column. A set of one or more virtual column units, and data that associates the set of one or more column units with the set of one or more virtual column units, are also stored in memory. The set of one or more virtual column units includes a particular virtual column unit storing results that are derived by evaluating an expression on at least one column of the on-disk table.
-
Citations
17 Claims
-
1. A method comprising:
-
storing, in volatile or non-volatile memory, a set of one or more column units; wherein the set of one or more column units correspond to one or more columns; wherein each column unit of the set of one or more column units includes data items from the column to which the column unit corresponds; wherein the one or more columns belong to one or more on-disk tables within a database managed by a database server instance; wherein the set of one or more column units includes a particular column unit that corresponds to at least one particular column of a particular table within the database; storing, in volatile or non-volatile memory, a set of one or more virtual column units; wherein the set of one or more virtual column units includes a particular virtual column unit that stores results that are derived by evaluating an expression on the at least one particular column; storing, in volatile or non-volatile memory, data that associates the set of one or more column units with the set of one or more virtual column units; wherein the set of one or more column units belong to a first in-memory columnar unit; wherein the set of one or more virtual column units belong to a first in-memory expression unit; wherein the first in-memory columnar unit and the first in-memory expression unit correspond to a first set of rows from the one or more columns; wherein the results stored in the particular virtual column unit are derived using values in the first set of rows from the at least one particular column; wherein the first set of rows include a first row and a second row; maintaining, within a shared metadata unit, data that indicates which rows in the first set of rows have become stale within both the first in-memory columnar unit and the first in-memory expression unit storing, in volatile or non-volatile memory, data that associates the shared metadata unit with the first in-memory columnar unit and the first in-memory expression unit; in response to detecting an update to the first row, updating the data in the shared metadata unit to indicate that, within both the first in-memory columnar unit and the first in-memory expression unit, the first row has become stale; after updating the data in the shared metadata unit, receiving a query that requires evaluation of the expression; in response to receiving the query; based on the data in the shared metadata unit, determining that, within the first in-memory columnar unit and the first in-memory expression unit, the first row has become stale; responsive to determining that, within the first in-memory columnar unit and the first in-memory expression unit, the first row has become stale, evaluating the expression for the first row based on values obtained from a source other than the first in-memory columnar unit and the first in-memory expression unit; based on the data in the shared metadata unit, determining that, within the first in-memory columnar unit and the first in-memory expression unit, the second row is not stale; and responsive to determining that, within the first in-memory columnar unit and the first in-memory expression unit, the second row is not stale, obtaining results of the expression for the second row by reading cached results of the expression, for the second row, from the first in-memory expression unit. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. One or more non-transitory computer-readable media storing instructions which, when executed by one or more processors, cause:
-
storing, in volatile or non-volatile memory, a set of one or more column units; wherein the set of one or more column units correspond to one or more columns; wherein each column unit of the set of one or more column units includes data items from the column to which the column unit corresponds; wherein the one or more columns belong to one or more on-disk tables within a database managed by a database server instance; wherein the set of one or more column units includes a particular column unit that corresponds to at least one particular column of a particular table within the database; storing, in volatile or non-volatile memory, a set of one or more virtual column units; wherein the set of one or more virtual column units includes a particular virtual column unit that stores results that are derived by evaluating an expression on the at least one particular column; storing, in volatile or non-volatile memory, data that associates the set of one or more column units with the set of one or more virtual column units; wherein the set of one or more column units belong to a first in-memory columnar unit wherein the set of one or more virtual column units belong to a first in-memory expression unit; wherein the first in-memory columnar unit and the first in-memory expression unit correspond to a first set of rows from the one or more columns; wherein the results stored in the particular virtual column unit are derived using values in the first set of rows from the at least one particular column; wherein the first set of rows include a first row and a second row; maintaining, within a shared metadata unit, data that indicates which rows in the first set of rows have become stale within both the first in-memory columnar unit and the first in-memory expression unit; storing, in volatile or non-volatile memory, data that associates the shared metadata unit with the first in-memory columnar unit and the first in-memory expression unit; in response to detecting an update to the first row, updating the data in the shared metadata unit to indicate that, within both the first in-memory columnar unit and the first in-memory expression unit, the first row has become stale; after updating the data in the shared metadata unit, receiving a query that requires evaluation of the expression; in response to receiving the query; based on the data in the shared metadata unit, determining that, within the first in-memory columnar unit and the first in-memory expression unit, the first row has become stale; responsive to determining that, within the first in-memory columnar unit and the first in-memory expression unit, the first row has become stale, evaluating the expression for the first row based on values obtained from a source other than the first in-memory columnar unit and the first in-memory expression unit; based on the data in the shared metadata unit, determining that, within the first in-memory columnar unit and the first in-memory expression unit, the second row is not stale; and responsive to determining that, within the first in-memory columnar unit and the first in-memory expression unit, the second row is not stale, obtaining results of the expression for the second row by reading cached results of the expression, for the second row, from the first in-memory expression unit. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17)
-
Specification