Maintaining transactional consistency in the columnar engine
By loading fully visible data in the column cache and refreshing it when modified, the data consistency problem in the column cache is solved, and the effect of memory saving and efficient query is achieved.
Patent Information
- Application Number
- CN202380029874.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-09-23
- Filing Date
- 2023-04-07
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2043-04-07
AI Technical Summary
When using columnar cache, how to maintain transaction consistency to ensure that all data visible to the ongoing transactions in the database system are correctly reflected at any point in time, especially when the data is modified.
By loading fully visible data in the column cache and invalidating the corresponding data when the data is modified, then refreshing the column cache asynchronously to replace the invalid block, ensuring that only the latest fully visible data is retained. If an invalid block is encountered during query, prefetching data from the row storage.
It realizes that only one version of fully visible data is retained in the column cache, reduces memory requirements, simplifies implementation, and ensures data consistency and efficient queries through block-level failure and asynchronous prefetching.
Smart Images

Figure CN118922825B_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application is a continuation of U.S. patent application No. 17 / 951,193 filed on September 23, 2022, which claims the benefit of the filing date of U.S. Provisional Patent Application No. 63 / 339,601 filed on May 9, 2022, and the disclosures of that U.S. patent application and that U.S. Provisional Patent Application are hereby incorporated by reference into this document. Background Art
[0003] A database management system (DBMS) is a system for managing one or more databases and for receiving and resolving queries against the managed databases. A DBMS manages one or more data tables or relations that are stored on one or more storage devices and form part of one or more managed databases. A DBMS can read and write to individual rows or columns of the managed tables, including updating, deleting, and adding records.
[0004] A DBMS may implement a cache for temporarily storing database data. The cache may store data blocks representing rows of base database tables. Data in the cache may be stored in either column-major or row-major format. Elements of a table stored in column-major format are stored contiguously in memory by column, while elements of a table stored in row-major format are stored contiguously in memory by row. A cached block becomes invalid when the corresponding block of the base table from which the cached block was retrieved is modified after the cached block was cached. The invalidated block no longer reflects data updated from the base table from which the data was cached.
[0005] A database cache that stores data in column-major format is a columnar cache. A columnar cache can efficiently serve analytical queries by caching a subset of tables / columns in memory in column-major format. Columnar caches are particularly well-suited for databases that maintain tables in row-major format. Columnar caches can improve performance by accessing only relevant columns with better compression support and using vectorized execution. A columnar cache can store data in terms of table fragments, which are virtual horizontal partitions of row-major data. Several consecutive blocks of rows are converted to column-major format, resulting in independent and self-describing table fragments. Within a table fragment, all values for a column are physically stored together to enable faster predicate filtering and aggregation.
[0006] Multi-version concurrency control (MVCC) creates a new version of a data item for each write. With MVCC in a DBMS, each Structured Query Language (SQL) statement sees a snapshot of the data (e.g., a database version) as it was some time ago, regardless of the current state of the underlying data. This prevents statements from viewing inconsistent data resulting from concurrent transactions performing updates on the same row of data, thereby providing transaction isolation for each database session. MVCC minimizes lock contention by avoiding the locking methods of traditional DBMSs in order to achieve reasonable performance in a multi-user environment. The main advantage of using the MVCC model for concurrency control rather than locking is that, in MVCC, locks acquired to query (e.g., read) data do not conflict with locks acquired to write data, and therefore reads never block writes, and writes never block reads.
[0007] When a columnar cache is added to a DBMS, data is cached in a columnar format in the columnar cache. Since data is modified concurrently, transactions that perform columnar cache reads need to see transactionally consistent data and thus comply with the isolation level of that transaction. Summary of the Invention
[0008] Various aspects of the present disclosure relate to maintaining transactional consistency when using a columnar cache. At any point in time, the columnar cache may contain only data that is visible to all ongoing transactions in the database system. The columnar cache may be initially loaded with fully visible data, and as data is modified, the corresponding data is invalidated in the columnar cache. As more data becomes invalid due to modifications performed by users after the initial load, the corresponding data may be refreshed in the columnar cache. As part of the refresh, the latest fully visible data may be populated while queries are still using old data in the columnar cache. When all queries transition to using the newly populated data, the old data may be removed from the columnar cache. Invalidation may be performed at the block level of the columnar cache. If a block is valid in the columnar cache, the block may contain only fully visible data. Queries may use valid blocks of the columnar cache and refer to the row store for invalid blocks. When a query begins using the columnar cache, a request may be submitted to asynchronously prefetch invalid blocks from the row store.
[0009] One aspect of the present disclosure provides a method for maintaining transactional consistency when retrieving data from a column cache. The method includes: loading a first plurality of blocks corresponding to data into the column cache using one or more processors; invalidating the one or more blocks using the one or more processors when data corresponding to one or more blocks in the first plurality of blocks is modified in a corresponding row store; and refreshing the column cache using a second plurality of blocks corresponding to the modified data to replace the invalidated blocks using the one or more processors.
[0010] In one example, the first plurality of blocks includes valid blocks corresponding to all visible data. In another example, the method further includes: performing, using one or more processors, a row store operation to retrieve data for the failed blocks. In yet another example, the method further includes: pre-fetching, using one or more processors, the modified data from the row store.
[0011] In yet another example, the method further includes determining, using one or more processors, to flush the column cache based on the effectiveness of the column cache. In yet another example, the effectiveness of the column cache is based on whether the column cache has been consistently not selected for retrieving data a predetermined number of times. In yet another example, the column cache is not selected based on a number of failed blocks in the column cache.
[0012] Another aspect of the present disclosure provides a system comprising: one or more processors; and one or more storage devices coupled to the one or more processors and storing instructions that, when executed by the one or more processors, cause the one or more processors to perform operations for maintaining transactional consistency when retrieving data from a column cache. The operations include: loading a first plurality of blocks corresponding to data into the column cache; invalidating the one or more blocks when data corresponding to one or more of the first plurality of blocks is modified in a corresponding row store; and refreshing the column cache with a second plurality of blocks corresponding to the modified data to replace the invalidated blocks.
[0013] In one example, the first plurality of blocks includes valid blocks corresponding to all visible data. In another example, the operations further include: performing a row store operation to retrieve a failed block for the data. In yet another example, the operations further include: pre-fetching the modified data from the row store.
[0014] In yet another example, the operations further include: determining to flush the column cache based on effectiveness of the column cache. In yet another example, the effectiveness of the column cache is based on whether the column cache has been consistently not selected for retrieving data a predetermined number of times. In yet another example, the column cache is not selected based on a number of failed blocks in the column cache.
[0015] Yet another aspect of the present disclosure provides a non-transitory computer-readable medium for storing instructions that, when executed by one or more processors, cause the one or more processors to perform operations for maintaining transactional consistency when retrieving data from a column cache. The operations include: loading a first plurality of blocks corresponding to data into the column cache; invalidating the one or more blocks when data corresponding to one or more blocks in the first plurality of blocks is modified in a corresponding row store; and refreshing the column cache with a second plurality of blocks corresponding to the modified data to replace the invalidated blocks.
[0016] In one example, the first plurality of blocks includes valid blocks corresponding to all visible data. In another example, the operations further include: performing a row store operation to retrieve a failed block for the data. In yet another example, the operations further include: pre-fetching the modified data from the row store.
[0017] In yet another example, the operations further include: determining to flush the column cache based on effectiveness of the column cache. In yet another example, the effectiveness of the column cache is based on whether the column cache has been consistently not selected for retrieving data a predetermined number of times. In yet another example, the column cache is not selected based on a number of failed blocks in the column cache. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 Depicted is a block diagram of an example database management system (DBMS) configured to maintain transactional consistency when using a columnar cache, in accordance with aspects of the present disclosure.
[0019] Figure 2 Depicted is a block diagram of a column cache with cached data in accordance with aspects of the present disclosure.
[0020] Figure 3 Depicted is a flow diagram of an example process for maintaining transactional consistency when using a columnar cache, in accordance with aspects of the present disclosure.
[0021] Figure 4 An example columnar cache with committed data blocks is depicted in accordance with aspects of the present disclosure.
[0022] Figure 5 An example columnar cache with some invalidated data is depicted in accordance with aspects of the present disclosure.
[0023] Figure 6 An example columnar cache is depicted in which refreshed data replaces stale data in accordance with aspects of the present disclosure.
[0024] Figure 7Depicted is a block diagram of an example computing environment that implements a DBMS that maintains transactional consistency in a columnar cache in accordance with aspects of the present disclosure. DETAILED DESCRIPTION
[0025] Generally disclosed herein is an implementation for maintaining transactional consistency when using a columnar cache. At any point in time, the columnar cache may contain only data visible to all ongoing transactions in the database system. The columnar cache may be initially loaded with fully visible data, and as data is modified, the corresponding data may be invalidated in the columnar cache. While MVCC requires maintaining multiple versions of data, the columnar cache only needs to contain a single version visible to everyone.
[0026] As more data becomes invalid in the column cache due to modifications performed by the user after the initial load, the effectiveness of the column cache may decrease, and the query planner may stop selecting the column cache to serve queries. When the query planner does not select the column cache due to a large number of invalid blocks for a predetermined number of times, the corresponding data may be refreshed in the column cache. This refresh can be transparent to ongoing queries. As part of the refresh, the latest fully visible data can be populated while queries are still using the old data in the column cache. When all queries are transitioned to using the newly populated data, the old data can be removed from the column cache. This refresh can be performed periodically in the background. Each table fragment can be refreshed independently.
[0027] Invalidation can be performed at the block level in the columnar cache. With block-level invalidation, data can be marked as valid or invalid at the block level in the columnar cache. If a block is valid in the columnar cache, it may only contain fully visible data. Queries can use valid blocks in the columnar cache and fall back to the row store for invalid blocks. When a query begins using the columnar cache, a request can be submitted to asynchronously prefetch invalid blocks from the row store.
[0028] With the implementation generally disclosed herein, the column cache no longer needs to be multi-versioned; instead, the column cache can contain only the fully visible data version. However, the column cache can still provide multi-versioning functionality by reading invalidated blocks from the buffer cache and patching the result set of the read query. Because only one version can be maintained in the column cache, significant memory savings can result. Block-level invalidation can simplify the implementation and reduce the amount of metadata required for the column cache.
[0029] Figure 1A block diagram depicts an example database management system (DBMS) 100 configured to maintain transactional consistency when using a columnar cache. DBMS 100 can be implemented on one or more computing devices in one or more physical locations. For example, DBMS 100 can be configured to manage data on a computing platform of a computing device, which can include multiple computing devices and / or storage devices. DBMS 100 can include a cache coherence engine 101, a columnar cache 110, a query execution engine 120, and a database 130.
[0030] DBMS 100 may be configured to receive a query (such as query 108 from computing device 105) and resolve the query by providing a response (such as query response 112). The query response may include one or more rows or columns, or portions of one or more rows or columns, of one or more tables of database 130. Before providing the query response, DBMS 100 may optionally process the data, for example, by sorting the rows in the response. The operations for processing the query response may be provided as part of the received query and / or be part of a predetermined pipeline that DBMS 100 is configured to execute as part of resolving the query.
[0031] Computing device 105 can be any of a variety of computing devices configured to query a database. For example, computing device 105 can be a personal laptop, a server, a wearable device, a sensor, etc. Computing device 105 can be user-operated and include peripherals or other components for receiving user input. In other examples, computing device 105 can be configured to communicate with DBMS 100 automatically, for example, as part of a computer program, script, or hardware / firmware operation executed by computing device 105. DBMS 100 and computing device 105 can communicate via a network and / or any of a variety of different types of wired or wireless connections.
[0032] In some examples, DBMS 100 may be a hybrid transaction and analytical processing system (HTAP). An HTAP system is a database management system configured to perform online transaction processing (OTAP) and online analytical processing (OLAP). An OTAP system is configured to coordinate and execute transactions between communicating computing devices. Transactions are recorded and updated in a corresponding database managed by the OTAP system. An OLAP system is configured to receive and resolve queries to a database as part of an analysis of the data stored in the database. OLAP systems and OTAP systems are optimized separately for their respective use cases, with OLAP systems typically optimized for read-only access to data and OTAP systems optimized for both read and write access to the queried data.
[0033] To improve query resolution performance, DBMS 100 may implement a columnar cache 110. Queries to OLAP systems and HTAP systems that support OLAP may include requests for data referenced by columns of tables in the database, rather than references to individual rows as is more common in HTAP. To speed up column-based query resolution, DBMS 100 may implement a columnar cache 110.
[0034] Column cache 110 can be implemented asynchronously, so sometimes column cache 110 may contain stale data, which may be referred to as invalid blocks. At least for some applications (such as HTAP systems), the system must answer queries and simultaneously accept updates to the base tables from which data is cached. DBMS 100 can implement hybrid query execution to enable the use of asynchronous column caches by allowing queries to be executed for which data is retrieved from both column cache 110 and database 130.
[0035] Figure 2 A block diagram of a column cache 110 with cached data is depicted. Figure 2 , a column cache 110 is shown as a cache portion of a database table 201. Columns 5, 15, 25, 35, and 45 in the column cache 110 may be referenced using corresponding table fragment indexes and row indexes. A group of rows may form a data block. Each data block 102, 104 has a corresponding index. Within each block 102, 104, each row of the table fragment has a corresponding row index. Each row of block 102, such as row 10, row 20, and row 30, may be referenced according to the corresponding row index. Similarly, rows 40, 50, and 60 may be referenced according to the corresponding row index. Multiple data blocks may be referred to as table fragments. Depending on performance and overhead requirements, the number of blocks of a table fragment may vary between different implementations, such as 4096 blocks per table fragment. It should be noted that a column cache may include any number of rows, columns, blocks, table fragments, etc., and Figure 2 The number of elements shown is for illustrative purposes only.
[0036] Column cache 110 may include any of a variety of different types of memory devices for caching data. For example, column cache 110 may be implemented in main memory, such as RAM or DRAM. Additionally or alternatively, column cache 110 may be implemented in persistent storage, such as on a solid-state drive or a hard disk drive.
[0037] Return Reference Figure 1, database 130 can be a collection of tables or relations that store data along multiple dimensions. For example, a table of database 130 can store data along rows and columns of the table. Database 130 can be implemented on a storage device such as a direct attached storage device, including a solid-state drive, a hard drive, a flash drive, a network attached storage device, an array of various combinations of different or identical storage devices, and the like.
[0038] Query execution engine 120 may be configured to receive query 108 and generate query response 112. Query 108 may be part of a workload executed by computing device 105 or some other device (not shown). A workload may refer to one or more computer programs or scripts that include operations for querying DBMS 100 for data. The workload may be automated and ongoing, or may be executed at pre-programmed intervals. In other examples, the workload is executed on demand by computing device 105, for example, in response to user input to device 105.
[0039] A query to DBMS 100 may include data specifying columns of data to be retrieved from DBMS 100. The specified data may be stored in column cache 110 or in database 130 at the time of execution. Query execution engine 120 may be configured to retrieve the queried data specified in a given query and return the data as part of a query response.
[0040] As part of resolving a query, DBMS 100 is configured to generate a query execution plan. DBMS 100 may include a planner 135, or a Figure 1 In some examples, planner 135 is shown communicating with a planner 135 external to DBMS 100. Planner 135 can generate a query execution plan according to any of a number of different processes. As part of generating the query execution plan, planner 135 can parse the received query and select corresponding query operations to be executed according to the plan based on a number of predetermined criteria. The predetermined criteria can be based on, for example, efficient use of computing or storage resources, the number of operations to be performed, the total time to execute the query, user input specifying certain types of operations to be performed, etc. Planner 135 can receive and parse the query to generate the query execution plan.
[0041] A query operation may refer to an action performed by the query execution engine 120 as part of executing or resolving a received query. Query operations may include reading data from or writing data to a memory, performing arithmetic or logical calculations, executing corresponding processes for sorting, hashing, joining, and scanning data, and the like. A query execution plan may be a directed graph, such as a tree, of nodes representing the different operations to be performed by the DBMS as part of executing a query. A query execution plan may also be represented as an ordered list or series of operations based on the order in which the planned operations must be performed to correctly execute the received and parsed query.
[0042] Query response 112 generated by query execution engine 120 is returned to computing device 105. In some examples, query response 112 may be returned to another destination computing device (not shown), which may be specified as a destination by computing device 105. Computing device 105 may continue to process query response 112 as part of a downstream process, which may include subsequent queries to DBMS 100 as part of the same or a different workload.
[0043] DBMS 100 may communicate data between computing device 105 and / or another computing device (not shown) using an interface (such as a graphical user interface) displayed on a display of computing device 105. The interface may include a plurality of user-interactive elements, such as buttons, toggles, sliders, checkboxes, etc., for modifying the behavior of DBMS 100 and / or displaying certain types of information currently described. In other examples, the interface may include an API that exposes DBMS 100, the API being used to modify various parameters related to the functionality of DBMS 100, such as cache configuration, based on calls to the API.
[0044] DBMS 100 may implement a cache coherence engine 101 to maintain cache coherence between column cache 110 and database 130. Cache coherence engine 101 may be configured to ensure that column cache 110 contains data that is visible or committed to ongoing transactions in DBMS 100 (e.g., queries 108 and responses 112). When data is modified (e.g., overwritten or deleted), blocks in column cache 110 representing the modified data are invalid or become invalid. Cache coherence engine 101 may mark a data block with an "invalid" or "valid" bit to identify the block as invalid or valid. When a block is invalidated, DBMS 100 may perform a row store operation (such as retrieving data from database 130) to read the modified data instead of retrieving the data from column cache 110. For invalid blocks, cache coherence engine 101 may asynchronously pre-fetch the invalid blocks from the row store for storage in a cache separate from column cache 110, such as a buffer cache or a file system cache (not shown). The cache coherence engine 101 allows for ensuring that only one version of the data needs to be maintained in the column cache 110 , while the data can still be retrieved quickly and accurately.
[0045] As more data becomes invalid in the column cache due to modifications, the effectiveness of the column cache may decrease, and the query planner 135 or query execution engine 120 may stop selecting column cache 110 to service queries. When the query planner 135 does not select column cache 110 due to a large number of invalid blocks for a predetermined number of times, the cache coherence engine 101 may refresh the corresponding data in column cache 110. This refresh may be transparent to ongoing queries. As part of the refresh, the latest fully visible or committed data may be populated in column cache 110 while queries are still using the old data in column cache 110. When all queries transition to using the newly populated data, the cache coherence engine 101 may remove the old data from column cache 110. This refresh may be performed periodically in the background. Each table fragment may be refreshed independently.
[0046] Figure 3 A flow chart of an example process 300 for maintaining transactional consistency when using a columnar cache is depicted. The example process 300 may be performed on a system of one or more processors in one or more locations, such as Figure 1 At any point in time, column cache 110 may contain data that is fully visible to ongoing transactions in DBMS 100.
[0047] As shown in block 310 , the cache coherence engine 101 may load fully visible data into the columnar cache 110 . Figure 4An example columnar cache 400 is depicted having fully visible data blocks 402, 404. While only two data blocks are shown for simplicity, it should be noted that a columnar cache may include any number of data blocks forming any number of table fragments.
[0048] As shown in block 320, when data is modified by a transaction, the cache coherence engine 101 invalidates the corresponding data in the column cache 110. The cache coherence engine 101 may perform invalidation at the block level of the column cache 110. Through block-level invalidation, data may be marked as valid / invalid at the block level in the column cache 110. Figure 5 An example columnar cache 400 is depicted in which a block 404 has been invalidated. Invalidated data is illustrated by a cross. The query execution engine 120 can retrieve data from valid blocks in the columnar cache 110, and for invalid blocks in the columnar cache 110, data can be retrieved from the row store of the database 130. To increase the speed at which data is retrieved, the cache coherence engine 101 can prefetch invalid blocks from the row store of the database 130. If an invalid block is not filtered by a predicate in the query (e.g., a WHERE clause), the invalid block can be prefetched. The invalid block can be prefetched into a cache separate from the columnar cache 110, such as a buffer cache or a file system cache.
[0049] As shown in block 330 , once the validity of the column cache 110 drops sufficiently low, the cache coherence engine 101 flushes the column cache 110 with the latest committed data. Figure 6 Depicts a diagram in which the refreshed data 504 replaces the previously Figure 5108 . An example columnar cache 400 is shown with invalidated data 404 illustrated with a cross in FIG. As more data becomes invalidated in columnar cache 110 due to data modifications based on executed transactions, the effectiveness of columnar cache 110 may decrease, causing query planner 135 or query execution engine 120 to stop selecting columnar cache 110 to service query 108. When columnar cache 110 performs no better than the row store in database 130, query planner 135 or query execution engine 120 stops selecting columnar cache 110. For example, when more than 50% of the blocks in columnar cache 110 are invalid, columnar cache 110 may not perform better than the row store. Query planner 135 may estimate the cost of retrieving invalidated blocks from the columnar cache and patching the result set of the query being read. If the cost is above a threshold or is higher than the cost of retrieving data entirely from the row store, query planner 135 will not select columnar cache 110. When the query planner 135 or query execution engine 120 does not select the column cache 110 for a predetermined number of times (e.g., 5 times based on a balance between miscounting and avoiding thrashing), the cache coherence engine 101 refreshes the data in the column cache 110. This refresh can be transparent to the ongoing query 108. As part of the refresh, the newly committed data can be populated while the query 108 is still using the old data that was previously populated in the column cache 110. When all queries are transitioned to using the newly populated data, the old data can be removed from the column cache 110. The cache coherence engine 101 can perform refreshes periodically in the background while transactions are occurring. The cache coherence engine 101 can also refresh individual data blocks, individual table fragments, or the entire column cache 110 independently.
[0050] Figure 7 A block diagram of an example computing environment 600 implementing a DBMS 100 that maintains transactional consistency in a columnar cache is depicted. DBMS 100 can be implemented on one or more devices having one or more processors in one or more locations, such as in a server computing device 615. User computing devices 612 and server computing devices 615 can be communicatively coupled to one or more storage devices 630 via a network 660. Server computing devices 615 and storage devices 630 can form part of a computing platform 601. Computing platform 601 can be a cloud computing platform, thereby providing a variety of different services, such as for providing computing and storage resources to platform users.
[0051] The storage device 630 may be a combination of volatile and non-volatile memory and may be located at the same or a different physical location than the computing devices 612, 615. For example, the storage device 630 may include any type of non-transitory computer-readable medium capable of storing information, such as a hard drive, a solid-state drive, a tape drive, optical storage, a memory card, ROM, RAM, DVD, CD-ROM, writable memory, and read-only memory.
[0052] The server computing device 615 may include one or more processors 613 and memory 614. The memory 614 may store information accessible by the processor 613, including instructions 621 executable by the processor 613. The memory 614 may also include data 623 that can be retrieved, manipulated, or stored by the processor 613. The memory 614 may be a type of non-transitory computer-readable medium, such as volatile memory and non-volatile memory, capable of storing information accessible by the processor 613. The processor 613 may include one or more central processing units (CPUs), graphics processing units (GPUs), field programmable gate arrays (FPGAs), and / or application-specific integrated circuits (ASICs), such as tensor processing units (TPUs).
[0053] Instructions 621 may include one or more instructions that, when executed by processor 613, cause one or more processors to perform actions defined by the instructions. Instructions 621 may be stored in an object code format for direct processing by processor 613, or in other formats, including interpretable scripts or a collection of independent source code modules that are interpreted on demand or compiled in advance. Instructions 621 may include instructions for implementing system 100 consistent with various aspects of the present disclosure. System 100 may be executed using processor 613 and / or using other processors located remotely from server computing device 615.
[0054] Data 623 can be retrieved, stored, or modified by processor 613 according to instructions 621. Data 623 can be stored in a computer register, as a table with multiple different fields and records in a relational or non-relational database, or as a JSON, YAML, proto, or XML document. Data 623 can also be formatted in a computer-readable format, such as, but not limited to, binary values, ASCII, or Unicode. In addition, data 623 can include information sufficient to identify the relevant information, such as a number, descriptive text, proprietary code, pointer, reference to data stored in other storage (including other network locations), or information used by a function to calculate related data.
[0055] The user computing device 612 may also be configured similarly to the server computing device 615, with one or more processors 616, memory 617, instructions 618, and data 619. The user computing device 612 may also include a user output 626 and a user input 624. The user input 624 may include any suitable mechanism or technology for receiving input from a user, such as a keyboard, a mouse, a mechanical actuator, a soft actuator, a touch screen, a microphone, and a sensor.
[0056] The server computing device 615 may be configured to transmit data to the user computing device 612, and the user computing device 612 may be configured to display at least a portion of the received data on a display implemented as part of the user output 626. The user output 626 may also be used to display an interface between the user computing device 612 and the server computing device 615. The user output 626 may alternatively or additionally include one or more speakers, transducers or other audio outputs, haptic interfaces, or other tactile feedback that provides non-visual and non-audible information to a platform user of the user computing device 612.
[0057] Although Figure 7 Processors 613, 616 and memories 614, 616 are illustrated as being within computing devices 615, 612, but the components described in this specification (including processors 613, 616 and memories 614, 617) may include multiple processors and memories that are in different physical locations and not operating within the same computing device. For example, some of instructions 621, 618 and data 623, 619 may be stored on a removable SD card, while others may be stored within a read-only computer chip. Some or all of the instructions and data may be stored in a location physically remote from the processors 613, 616 but still accessible to the processors 613, 616. Similarly, processors 613, 616 may include a collection of processors that can perform concurrent and / or sequential operations. Computing devices 615, 612 may each include one or more internal clocks that provide timing information, which may be used to measure the time of operations and programs executed by the computing devices 615, 612.
[0058] The server computing device 615 can be configured to receive requests from the user computing device 612 to process data. For example, the environment 600 can be part of a computing platform configured to provide a variety of services to users through various user interfaces and / or APIs that expose platform services. One or more of the services can be a machine learning framework or a set of tools for generating neural networks or other machine learning models based on specified tasks and training data. The user computing device 612 can receive and transmit data specifying target computing resources to be allocated for executing a neural network trained to perform a specific neural network task.
[0059] Devices 612, 615 may be able to communicate directly and indirectly over network 660. Devices 615, 612 may set up listening sockets that may accept initiated connections for sending and receiving information. Network 660 itself may include a variety of configurations and protocols, including the Internet, the World Wide Web, an intranet, a virtual private network, a wide area network, a local area network, and a private network using one or more company-specific communication protocols. Network 660 may support a variety of short-range and long-range connections. Short-range and long-range connections may be made over different bandwidths, such as those typically associated with 2.402GHz to 2.480GHz, usually associated with the standard 2.4GHz and 5GHz associated communication protocols; or using multiple communication standards, such as for wireless broadband communication Additionally or alternatively, the network 660 may also support wired connections between the devices 612, 615 (including through various types of Ethernet connections).
[0060] although Figure 7 6. A single server computing device 615 and user computing device 612 are shown in FIG. 6, but it should be understood that aspects of the present disclosure may be implemented according to a variety of different configurations and numbers of computing devices (including in examples for sequential or parallel processing), or through a distributed network of multiple devices. In some implementations, aspects of the present disclosure may be performed on a single device or any combination thereof.
[0061] Various aspects of the present disclosure may be implemented in digital circuitry, computer-readable storage media, as one or more computer programs, or a combination of one or more of the foregoing. The computer-readable storage medium may be non-transitory, for example, as one or more instructions executable by a cloud computing platform and stored on a tangible storage device.
[0062] In this specification, the phrase "configured to" is used in different contexts in relation to a computer system, hardware, or part of a computer program, engine, or module. When a system is said to be configured to perform one or more operations, this means that the system has appropriate software, firmware, and / or hardware installed on the system that, when in operation, causes the system to perform the one or more operations. When a piece of hardware is said to be configured to perform one or more operations, this means that the hardware includes one or more circuits that, when in operation, receive inputs and generate outputs based on the inputs and corresponding to the one or more operations. When a computer program, engine, or module is said to be configured to perform one or more operations, this means that the computer program includes one or more program instructions that, when executed by one or more computers, cause the one or more computers to perform the one or more operations.
[0063] Although the operations shown in the drawings and described in the claims are shown in a particular order, it should be understood that the operations may be performed in a different order than shown, and that some operations may be omitted, performed more than once, and / or performed in parallel with other operations. Furthermore, the separation of different system components configured to perform different operations should not be construed as requiring separation of the components. The components, modules, programs, and engines described may be integrated together as a single system or as part of multiple systems.
[0064] Unless otherwise stated, the foregoing alternative examples are not mutually exclusive, but may be implemented in various combinations to achieve unique advantages. Since these and other variations and combinations of the features discussed above may be utilized without departing from the subject matter defined by the claims, the description of the foregoing embodiments should be made in an illustrative manner rather than in a manner that limits the subject matter defined by the claims. In addition, the examples described herein and the provision of clauses expressed as "such as," "including," etc. should not be interpreted as limiting the subject matter of the claims to specific examples; rather, these examples are intended to illustrate only one of many possible embodiments. In addition, the same reference numerals in different figures may identify the same or similar elements.
Claims
1. A system configured to maintain transactional consistency when using a columnar cache, characterized in that The system comprises: one or more processors; and one or more storage devices coupled to the one or more processors and storing instructions that, when executed by the one or more processors, cause the one or more processors to perform operations for maintaining transactional consistency when retrieving data from a columnar cache, the operations comprising: loading a first plurality of blocks corresponding to data in a row store into the columnar cache, each block in the first plurality of blocks comprising a row group and an index; In response to data corresponding to one or more blocks of the first plurality of blocks being modified in the row store, invalidating the one or more blocks; and The columnar cache is refreshed by replacing failed blocks with a second plurality of blocks corresponding to the modified data in the row store without replacing valid blocks of the columnar cache.
2. The system according to claim 1, wherein The first plurality of blocks includes valid blocks corresponding to all visible data.
3. The system according to claim 1, wherein: Wherein the operations further include performing a row store operation to retrieve modified data for the failed block.
4. The system according to claim 3, wherein: The operation further includes pre-fetching the modified data from a row store.
5. The system according to claim 1, wherein: Wherein the operations further include determining to flush the column cache based on the validity of the column cache.
6. The system according to claim 5, wherein: The validity of the column cache is based on the column cache being consistently not selected for retrieving data a predetermined number of times.
7. The system according to claim 6, wherein: The column cache is not selected based on a number of failed blocks in the column cache.
8. A method for maintaining transactional consistency when retrieving data from a column cache, characterized in that The method comprises: loading, using one or more processors, a first plurality of blocks corresponding to data in a row store into the column cache, each block in the first plurality of blocks comprising a row group and an index; In response to data corresponding to one or more blocks of the first plurality of blocks being modified in the row store, invalidating, using the one or more processors, the one or more blocks; and The column cache is refreshed with the one or more processors by replacing failed blocks with a second plurality of blocks corresponding to the modified data in the row store without replacing valid blocks of the column cache.
9. The method according to claim 8, wherein The first plurality of blocks includes valid blocks corresponding to all visible data.
10. The method according to claim 8, wherein Further including: A row store operation is performed with the one or more processors to retrieve modified data for the failed block.
11. The method according to claim 10, wherein Further including: The modified data is prefetched from a row store using the one or more processors.
12. The method according to claim 8, wherein Further including: Determining, with the one or more processors, to flush the column cache based on the validity of the column cache.
13. The method according to claim 12, wherein: The validity of the column cache is based on the column cache being consistently not selected for retrieving data a predetermined number of times.
14. The method according to claim 13, wherein The column cache is not selected based on a number of failed blocks in the column cache.
15. A non-transitory computer-readable medium for storing instructions, characterized in that The instructions, when executed by one or more processors, cause the one or more processors to perform operations for maintaining transactional consistency when retrieving data from a columnar cache, the operations comprising: loading a first plurality of blocks corresponding to data in a row store into the columnar cache, each block in the first plurality of blocks comprising a row group and an index; In response to data corresponding to one or more blocks of the first plurality of blocks being modified in the row store, invalidating the one or more blocks; and The columnar cache is refreshed by replacing failed blocks with a second plurality of blocks corresponding to the modified data in the row store without replacing valid blocks of the columnar cache.
16. The non-transitory computer-readable medium of claim 15, wherein Wherein the operations further include performing a row store operation to retrieve modified data for the failed block.
17. The non-transitory computer-readable medium of claim 16, wherein: The operation further includes pre-fetching the modified data from a row store.
18. The non-transitory computer-readable medium of claim 15, wherein Wherein the operations further include determining to flush the column cache based on the validity of the column cache.
19. The non-transitory computer-readable medium of claim 18, wherein The validity of the column cache is based on the column cache being consistently not selected for retrieving data a predetermined number of times.
20. The non-transitory computer-readable medium of claim 19, wherein The column cache is not selected based on a number of failed blocks in the column cache.
Citation Information
Patent Citations
Efficient methods and systems for consistent read in record-based multi-version concurrency control
CN106462586A
Granular creation and refresh of columnar data
US20150088824A1