Materialized view automatic incremental refreshing method based on ON STATEMENT, storage medium and product

By adopting the automatic incremental refresh method of ON STATEMENT mode in the materialized view and using the materialized view log to automatically refresh the materialized view, the problem of inconsistency between the materialized view and the base table when the base table data changes frequently is solved, improving performance and user experience, and realizing achieve real-time consistency.

CN118733585APending Publication Date: 2024-10-01CETC JINCANG (BEIJING) TECH CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202410822317.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The existing materialized view refresh mode causes the materialized view to be inconsistent with the base table data when base table data is frequently added, deleted, or modified. Users need to frequently refresh manually or use scheduled tasks, which affects performance and is cumbersome.

Method used

Use the automatic incremental refresh method of materialized views based on ON STATEMENT to create materialized view logs to record incremental operations on base table data, and use log information to automatically refresh materialized views to ensure real-time consistency between materialized views and base table data.

Benefits of technology

It reduces the tediousness of user operations and resource usage during the refresh process of materialized views, improves performance, and ensures real-time consistency between materialized views and base table data. Users do not need to refresh manually either within or outside a transaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733585A_ABST
    Figure CN118733585A_ABST
Patent Text Reader

Abstract

The invention provides an ON STATEMENT-based materialized view automatic incremental refreshing method, a machine readable storage medium and a computer program product.The method comprises the steps that a materialized view log about a base table is created firstly, and then when incremental operation aiming at base table data is generated, the materialized view log is updated; and updating the data change information of the base table to the materialized view log, determining the materialized view corresponding to each incremental operation, and completing incremental refreshing of all the materialized views by using log information in the materialized view log. Based on the technical scheme provided by the invention, the data of the increment part can be automatically refreshed to the materialized view whenever the data of the base table is added, deleted and modified, so that the influence on the adding, deleting and modifying performance of the base table is relatively small, the statement-level automatic increment refreshing can also ensure the real-time consistency of the materialized view and the data of the base table, and the data of the materialized view can be automatically refreshed in a transaction or out of the transaction. And particularly, the data updating of the base table is relatively frequent, so that the user can directly use the data in the materialized view, and the use is convenient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of databases, and in particular to an automatic incremental refresh method for materialized views based on ON STATEMENT, a machine-readable storage medium, and a computer program product. Background Art

[0002] A materialized view is a database object that contains query results. It is a special physical table that stores data. When the base table data changes, the materialized view needs to be refreshed to ensure that the materialized view obtains the latest query results relative to the latest data in the base table.

[0003] Currently, there are two materialized view refresh modes:

[0004] a)ON DEMAND (Specifying ON DEMAND means that the database does not refresh the materialized view unless the user refreshes it manually. Specifying ON DEMAND means that the database does not refresh the materialized view unless the user refreshes it manually.)

[0005] b)ON COMMIT (Specify ON COMMIT to indicate that a refresh is to occur whenever the database commits a transaction that operates on a master table of the materialized view. Specify ON COMMIT to indicate that a refresh is to occur whenever the database commits a transaction that operates on a master table of the materialized view)

[0006] For mode a)

[0007] The materialized view can be refreshed manually when the user needs it, or it can be refreshed regularly through a JOB to ensure consistency with the base table data.

[0008] When the base table data is frequently added, deleted, and modified, it is likely that the materialized view and the base table data will be inconsistent. If you want the data to be consistent, you need to manually refresh the materialized view every time you use it, or use a job to perform a scheduled refresh. The former manual refresh makes it cumbersome for users to use, and the latter continuous refresh process takes up time and resources, greatly affecting performance, especially when there is no data change in the base table, and there is no need to perform a refresh operation at all.

[0009] For mode b)

[0010] Once the base table has an explicit COMMIT, that is, an explicit transaction commit, the materialized view is refreshed immediately to ensure consistency with the base table data.

[0011] When adding, deleting, or modifying base table data, the changed base table data can only be refreshed to the materialized view after the transaction is committed. Therefore, within a transaction, when adding, deleting, or modifying base tables at any time, the consistency between the materialized view and the base table data must be ensured. Users are required to manually refresh the materialized view each time they use it, which makes it cumbersome for users to use. Summary of the invention

[0012] An object of the first aspect of the present invention is to reduce user operations during a materialized view refresh process.

[0013] A further object of the first aspect of the present invention is to reduce the time and resources occupied by refreshing materialized views.

[0014] Another further object of the first aspect of the present invention is to reduce the time impact of adding, deleting and modifying base tables during the materialized view refresh process.

[0015] A further object of the first aspect of the present invention is to ensure the consistency of the materialized view and the base table data within the transaction, while ensuring that the user is not cumbersome to use.

[0016] A second aspect of the present invention is to provide a machine-readable storage medium.

[0017] A third aspect of the present invention is directed to a computer program product.

[0018] In particular, the present invention provides an automatic incremental refresh method for materialized views based on ON STATEMENT, comprising:

[0019] Create a materialized view log about the base table;

[0020] When an incremental operation is generated for the base table data, the data change information of the base table is updated to the materialized view log and the materialized view corresponding to each incremental operation is determined;

[0021] The incremental refresh of all the materialized views is completed by using the log information in the materialized view log.

[0022] Optionally, the step of determining the materialized view corresponding to each incremental operation includes:

[0023] Creating a materialized view system table based on the correspondence between the base table data and the materialized view;

[0024] The materialized view corresponding to each incremental operation data is determined according to the materialized view system table.

[0025] Optionally, the step of completing the incremental refresh of all the materialized views using the log information in the materialized view log includes:

[0026] For one of the materialized views, incrementally refresh the materialized view using all log information corresponding to the materialized view in the materialized view log, and after completion, continue to incrementally refresh other materialized views that have not been incrementally refreshed using the log information in the materialized view log until all the materialized views have completed incremental refresh.

[0027] Optionally, the step of incrementally refreshing the materialized view using all log information corresponding to the materialized view in the materialized view log includes:

[0028] Reading a log message corresponding to the materialized view in the materialized view log, using the log message to incrementally refresh the materialized view, and after completion, continuing to read other log messages corresponding to the materialized view in the materialized view log to incrementally refresh the materialized view until the materialized view log does not contain any log messages corresponding to the materialized view that have not been incrementally refreshed.

[0029] Optionally, the step of incrementally refreshing the materialized view using the log information includes:

[0030] Determine the log type of the log information;

[0031] The materialized view is incrementally refreshed according to the log type.

[0032] Optionally, if the log type is deletion, the step of incrementally refreshing the materialized view according to the log type includes:

[0033] Delete the corresponding data row in the materialized view.

[0034] Optionally, if the log type is increment, the step of incrementally refreshing the materialized view according to the log type includes:

[0035] Insert corresponding data rows into corresponding positions of the materialized view.

[0036] Optionally, the incremental operation is committed in an implicit transaction commit manner.

[0037] According to another aspect of the present invention, a machine-readable storage medium is provided, on which a machine executable program is stored. When the machine executable program is executed by a processor, the method for automatically refreshing a materialized view based on ONSTATEMENT according to any one of the above items is implemented.

[0038] According to another aspect of the present invention, a computer program product is provided, including a computer executable program, which, when executed by a processor, implements the method for automatic incremental refresh of materialized views based on ON STATEMENT according to any one of the above items.

[0039] In the method for automatically refreshing materialized views based on ON STATEMENT proposed by the present invention, a materialized view log about a base table is first created, and then when an incremental operation is generated for the base table data, the data change information of the base table is updated to the materialized view log and the materialized view corresponding to each incremental operation is determined, and then the log information in the materialized view log is used to complete the incremental refresh of all materialized views. Based on the technical solution provided by the present invention, whenever the base table data is added, deleted or modified, the incremental part of the data will be automatically refreshed to the materialized view, so the performance of adding, deleting or modifying the base table is less affected, and the time and resource occupation are also less. This statement-level automatic incremental refresh can also ensure the real-time consistency between the materialized view and the base table data, and no manual refresh is required by the user, whether in or outside a transaction.

[0040] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below.

[0041] Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Hereinafter, some specific embodiments of the present invention will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:

[0043] Figure 1 It is a flowchart of an automatic incremental refresh method of a materialized view based on ON STATEMENT according to an embodiment of the present invention;

[0044] Figure 2It is a complete flow chart of the method for automatic incremental refresh of materialized views based on ON STATEMENT according to an embodiment of the present invention;

[0045] Figure 3 is a schematic structural block diagram of a machine-readable storage medium according to an embodiment of the present invention;

[0046] Figure 4 is a schematic structural block diagram of a computer program product according to an embodiment of the present invention. DETAILED DESCRIPTION

[0047] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0048] It should be noted that the technical features in the embodiment and optional embodiments of the present invention can be combined with each other under the premise of no conflict.

[0049] Figure 1 The present invention is a flowchart of a materialized view automatic incremental refresh method based on ON STATEMENT (Specify ON STATEMENT to indicate that an automatic refresh is to occur every time a DML operation is performed on any of the materialized view's base tables) according to an embodiment of the present invention.

[0050] See also Figure 1 As shown, the method for automatically refreshing materialized views based on ON STATEMENT proposed by the present invention may at least include the following steps S102-S106.

[0051] Step S102: Create a materialized view log about the base table.

[0052] The base table is a table permanently stored in the database. It is a logical representation of the actual stored data. In the database, the base table is an independent table. In SQL, one relationship corresponds to one base table. All base tables constitute the database schema. The base table is a logical representation of the actual stored data in the database. It corresponds to the actual relationship. The data in the relational model is the rows of the base table and the attributes are the columns.

[0053] In this step, the materialized view log of the base table is used to store the addition, deletion, and modification data change information of the base table, and is used to obtain the changed data rows of the base table during incremental refresh.

[0054] Step S104: when an incremental operation on the base table data is generated, the data change information of the base table is updated to the materialized view log and the materialized view corresponding to each incremental operation is determined.

[0055] The data in the materialized view comes from the base table.

[0056] Step S106: using the log information in the materialized view log to complete the incremental refresh of all materialized views.

[0057] The materialized view in this step is a materialized view that meets the automatic incremental refresh conditions in ON STATEMENT mode, which ensures that it can be incrementally refreshed.

[0058] In this step, one log message in the materialized view log may correspond to the data change information corresponding to one incremental operation.

[0059] In the embodiment of the present invention, a materialized view log about a base table is first created, and then when an incremental operation is generated for the base table data, the data change information of the base table is updated to the materialized view log and the materialized view corresponding to each incremental operation is determined, and then the log information in the materialized view log is used to complete the incremental refresh of all materialized views. Based on the technical solution provided by the present invention, whenever the base table data is added, deleted or modified, the incremental part of the data will be automatically refreshed to the materialized view, so the impact on the base table addition, deletion and modification performance is small, and the time and resource occupation is also small. This statement-level automatic incremental refresh can also ensure the real-time consistency of the materialized view and the base table data, whether in a transaction or outside a transaction, without the need for manual refresh by the user.

[0060] In some preferred or alternative embodiments according to the present invention, the incremental operation on the base table data mentioned in the above step S104 is committed in an implicit transaction commit manner.

[0061] Implicit transaction commit means that when no explicit transaction is started, MySQL will automatically treat each SQL statement as a separate transaction and automatically commit the transaction. This means that each SQL statement will be immediately committed to the database without the need to explicitly call the COMMIT statement.

[0062] In some preferred or alternative embodiments according to the present invention, determining the materialized view corresponding to each incremental operation mentioned in step S104 above includes:

[0063] Create a materialized view system table based on the correspondence between base table data and materialized view;

[0064] Determine the materialized view corresponding to each incremental operation data based on the materialized view system table.

[0065] The materialized view system table is created according to the correspondence between the base table data and the materialized view, so that the materialized view to which the data of each incremental operation belongs can be determined according to the materialized view system table.

[0066] In some preferred or alternative embodiments of the present invention, the incremental refresh of all materialized views using the log information in the materialized view log mentioned in step S106 above includes:

[0067] For a materialized view, use all the log information corresponding to the materialized view in the materialized view log to incrementally refresh the materialized view. After completion, continue to use the log information in the materialized view log to incrementally refresh other materialized views that have not been incrementally refreshed until all materialized views have completed incremental refresh.

[0068] When the incremental refresh of all materialized views is completed using the log information in the materialized view log, first, for one view, use all the log information corresponding to the materialized view in the materialized view log to incrementally refresh the materialized view. After completion, use the log information in the materialized view log to incrementally refresh other materialized logs that have not been incrementally refreshed one by one until there are no materialized views that have not been incrementally refreshed. At this time, it is confirmed that the incremental refresh of all materialized views is completed.

[0069] In some preferred or alternative embodiments according to the present invention, the incremental refreshing of the materialized view using all log information corresponding to the materialized view in the materialized view log mentioned above includes:

[0070] Read a log message corresponding to the materialized view in the materialized view log, use the log message to incrementally refresh the materialized view, and after completion, continue to read other log messages corresponding to the materialized view in the materialized view log to incrementally refresh the materialized view until the materialized view log does not contain any log messages corresponding to the materialized view that have not been incrementally refreshed.

[0071] In some preferred or alternative embodiments according to the present invention, the incremental refresh of the materialized view using log information mentioned above includes:

[0072] Determine the log type of the log information;

[0073] Incremental refresh of materialized views based on log type.

[0074] The log types include but are not limited to addition, deletion and modification.

[0075] In some preferred or alternative embodiments according to the present invention, if the log type is deletion, the incremental refresh of the materialized view according to the log type mentioned above includes:

[0076] Delete the corresponding data row in the materialized view.

[0077] If the log type is deletion, the log information may include deleted data, and the corresponding data row in the materialized view may be deleted according to the log information.

[0078] In some preferred or alternative embodiments according to the present invention, if the log type is increment, the incremental refresh of the materialized view according to the log type mentioned above includes:

[0079] Insert the corresponding data row into the corresponding position of the materialized view.

[0080] If the log type is addition, the log information may include the added data, and a corresponding data row may be inserted into a corresponding position in the materialized view according to the log information.

[0081] In some preferred or alternative embodiments according to the present invention, if the log type is modification, the incremental refresh of the materialized view according to the log type mentioned above includes:

[0082] Make corresponding data modifications in the materialized view.

[0083] If the log type is modification, the log information may include modified data, and the corresponding data in the materialized view may be modified according to the log information.

[0084] Figure 2 FIG. 1 is a complete flowchart of an automatic incremental refresh method for materialized views based on ON STATEMENT according to an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S202-S224.

[0085] Step S202: Create a materialized view log.

[0086] In this step, the materialized view log of the base table is used to store the addition, deletion, and modification data change information of the base table, and is used to obtain the changed data rows of the base table during incremental refresh.

[0087] Step S204: when an incremental operation on the base table data is generated, the data change information of the base table is updated to the materialized view log.

[0088] In this step, when DML operates the base table, the data addition, deletion, and modification information of the base table is written to the materialized view log.

[0089] In this step, DML (Data Manipulation Language) is a data manipulation language. Operations such as processing data in SQL are collectively referred to as data manipulation languages. Among them, INSERT---inserts data; DELETE---deletes data; UPDATE---modifies data; SELECT---queries data.

[0090] Step S206: Create a materialized view system table based on the correspondence between the base table data and the materialized view.

[0091] The data of the materialized view comes from the base table.

[0092] Step S208: Determine the materialized view corresponding to each incremental operation data according to the materialized view system table.

[0093] In this step, when each DML statement implicit transaction is committed, all ON STATEMENT materialized views corresponding to the base table are found by querying the materialized view system table.

[0094] Step S210: incrementally refresh a materialized view.

[0095] Step S212: Read a piece of log information corresponding to the materialized view from the materialized view log table.

[0096] Step S214: Determine whether the log type is INSERT. If yes, execute step S216; if no, execute step S218.

[0097] Step S216: Get the data row from the base table, insert the data row, and then execute step S220.

[0098] If the log type is INSERT, the corresponding data row is inserted into the materialized view.

[0099] Step S218: confirm that the log type is DELETE, delete the data row according to CTID or PRIMARY KEY or ROWID, and then execute step S220.

[0100] If the log type is DELETE, the corresponding data is deleted from the materialized view.

[0101] Step S220: Determine whether the materialized view log still contains log information corresponding to the materialized view. If yes, return to step S212; if no, execute step S222.

[0102] Step S222: Determine whether there is a materialized view that has not been incrementally refreshed. If yes, return to step S210; if no, execute step S224.

[0103] Step S224: Confirm that the incremental refresh is complete.

[0104] In this step, confirming that the incremental refresh is complete means confirming that the DML operation is complete.

[0105] The present invention proposes an automatic incremental refresh method for materialized views based on ON STATEMENT, firstly creating a materialized view log about a base table, then when an incremental operation is generated for base table data, updating the data change information of the base table to the materialized view log and determining the materialized view corresponding to each incremental operation, and then using the log information in the materialized view log to complete the incremental refresh of all materialized views. Based on the technical solution provided by the present invention, whenever the base table data is added, deleted or modified, the incremental part of the data will be automatically refreshed to the materialized view, so the impact on the base table addition, deletion and modification performance is small, and the time and resource occupation is also small, and this statement-level automatic incremental refresh can also ensure the real-time consistency of the materialized view and the base table data, whether in or outside the transaction, reducing the constraints on user use, especially when the base table data is updated frequently, the user does not need to care about when to synchronize and refresh, and can directly use the data in the materialized view, making it more convenient for users to use.

[0106] In addition, the automatic incremental refresh at the statement level in ON STATEMENT mode ensures the strong consistency of the data in the materialized view and the base table, and there is no need to worry about data expiration at any time.

[0107] Based on the same inventive concept, the present invention also provides a machine-readable storage medium, Figure 3 is a schematic structural block diagram of a machine-readable storage medium according to an embodiment of the present invention. Figure 3 As shown, a machine executable program 31 is stored on the machine-readable storage medium 30. When the machine executable program 31 is executed by a processor, the method for processing a database shared memory buffer pool in any of the above embodiments is implemented.

[0108] Based on the same inventive concept, the present invention also provides a computer program product. Figure 4 is a schematic structural block diagram of a computer program product according to an embodiment of the present invention. Figure 4 As shown, the computer program product 40 includes a computer executable program 41. When the computer executable program 41 is executed by a processor, it can implement the automatic incremental refresh method of materialized view based on ONSTATEMENT in any of the above embodiments.

[0109] It should be noted that the logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any machine-readable storage medium for use by an instruction execution system, device or equipment (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or equipment and execute instructions), or used in combination with these instruction execution systems, devices or equipment.

[0110] For the purposes of the description of this embodiment, the machine-readable storage medium 30 may be any device that can contain, store, communicate, propagate or transmit a program for use with an instruction execution system, device or apparatus or in conjunction with such instruction execution systems, devices or apparatuses. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection having one or more wirings (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium 30 may even be paper or other suitable medium on which the program may be printed, because the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0111] It should be understood that each part of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system.

[0112] The processor may be connected to an I / O interface (input / output interface) suitable for connecting the computer device to one or more I / O devices (input / output devices) via a system interconnect (e.g., PCI, PCI-Express, etc.). The I / O devices may include, for example, a keyboard and a pointing device, wherein the pointing device may include a touch pad or a touch screen, etc. The I / O devices may be built-in components of the computer device, or may be devices externally connected to the computing device.

[0113] The processor may also be linked to a display interface suitable for connecting a computer device to a display device through a system interconnection. The display device may include a display screen as a built-in component of the computer device. The display device may also include a computer monitor, a television or a projector, etc., which are externally connected to the computer device. In addition, a network interface controller (NIC) may be suitable for connecting a computer device to a network through a system interconnection. In some embodiments, the NIC may use any suitable interface or protocol (such as an Internet small computer system interface, etc.) to transmit data. The network may be a cellular network, a radio network, a wide area network (WAN), a local area network (LAN) or the Internet, etc. A remote device may be connected to a computing device through a network.

[0114] The flow chart provided by the present embodiment is not intended to indicate that the operation of the method will be performed in any particular order, or that all operations of the method are included in all every case. In addition, the method may include additional operations. Within the scope of the technical thinking provided by the present embodiment method, additional changes may be made to the above method.

[0115] At this point, those skilled in the art should recognize that, although multiple exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications that conform to the principles of the present invention can still be directly determined or derived based on the content disclosed in the present invention without departing from the spirit and scope of the present invention. Therefore, the scope of the present invention should be understood and recognized as covering all these other variations or modifications.

Claims

1. An automatic incremental refresh method for a materialized view based on ON STATEMENT, comprising: Create a materialized view log about the base table; When an incremental operation is generated for the base table data, the data change information of the base table is updated to the materialized view log and the materialized view corresponding to each incremental operation is determined; The incremental refresh of all the materialized views is completed by using the log information in the materialized view log.

2. The method for automatically refreshing materialized views based on ON STATEMENT according to claim 1 is characterized in that The step of determining the materialized view corresponding to each incremental operation includes: Creating a materialized view system table based on the correspondence between the base table data and the materialized view; The materialized view corresponding to each incremental operation data is determined according to the materialized view system table.

3. The method for automatically refreshing materialized views based on ON STATEMENT according to claim 1 is characterized in that The step of using the log information in the materialized view log to complete the incremental refresh of all the materialized views includes: For one of the materialized views, incrementally refresh the materialized view using all log information corresponding to the materialized view in the materialized view log, and after completion, continue to incrementally refresh other materialized views that have not been incrementally refreshed using the log information in the materialized view log until all the materialized views have completed incremental refresh.

4. The method for automatically refreshing materialized views based on ON STATEMENT according to claim 3 is characterized in that The step of incrementally refreshing the materialized view using all log information corresponding to the materialized view in the materialized view log includes: Reading a log message corresponding to the materialized view in the materialized view log, using the log message to incrementally refresh the materialized view, and after completion, continuing to read other log messages corresponding to the materialized view in the materialized view log to incrementally refresh the materialized view until the materialized view log does not contain any log messages corresponding to the materialized view that have not been incrementally refreshed.

5. The method for automatically refreshing materialized views based on ON STATEMENT according to claim 4 is characterized in that The step of incrementally refreshing the materialized view using the log information includes: Determine the log type of the log information; The materialized view is incrementally refreshed according to the log type.

6. The method for automatically refreshing materialized views based on ON STATEMENT according to claim 5, characterized in that If the log type is deletion, the step of incrementally refreshing the materialized view according to the log type includes: Delete the corresponding data row in the materialized view.

7. The method for automatically refreshing materialized views based on ON STATEMENT according to claim 5, characterized in that If the log type is increment, the step of incrementally refreshing the materialized view according to the log type includes: Insert corresponding data rows into corresponding positions of the materialized view.

8. The method for automatically refreshing materialized views based on ON STATEMENT according to claim 1, characterized in that The incremental operation is committed in an implicit transaction commit manner.

9. A machine-readable storage medium having a machine executable program stored thereon, wherein when the machine executable program is executed by a processor, the method for automatically refreshing a materialized view based on ON STATEMENT according to any one of claims 1 to 8 is implemented.

10. A computer program product, comprising a computer executable program, wherein when the computer executable program is executed by a processor, the method for automatically refreshing a materialized view based on ON STATEMENT according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Method and device for updating materialized view, medium and electronic equipment

    CN120763189A

  • Materialized view incremental refreshing method and device, equipment, medium and product

    CN120849430A

  • A materialized view incremental refresh method, device, equipment, medium and product

    CN120849430B

  • Incremental materialized view implementation method and device based on PostgreSQL database logic decoding

    CN122547809A

  • Incremental materialized view implementation method and device based on logical decoding of a PostgreSQL database

    CN122547809B