Method for dynamically configuring materialized view, electronic device and program product

Dynamically configure materialized views through the interface function package toolkit, solving the flexibility and real-time problems of materialized views in ClickHouse, simplifying the management and update process, and improving system efficiency and query performance.

CN120407579APending Publication Date: 2025-08-01BEIJING VENUS INFORMATION SECURITY TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510474673.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

The materialized view in ClickHouse affects the normal operation of the system when the table structure is modified, the query statement is difficult to modify, the manual update operation is cumbersome and there is a risk of historical data loss. There is a lack of DML statements that directly modify the materialized view table structure.

Method used

Provides a method of dynamically configuring materialized views, and uses the interface function encapsulation toolkit to create, add, delete, uninstall, load and reset materialized views, simplifying the management and update of materialized views.

Benefits of technology

It improves the flexibility and real-time nature of materialized views, reduces the complexity of manual operations and the risk of historical data loss, and improves the system's operating efficiency and query performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407579A_ABST
    Figure CN120407579A_ABST
Patent Text Reader

Abstract

The invention provides a method for dynamically configuring materialized views, electronic equipment and a program product. The method for dynamically configuring the materialized view comprises the following steps: creating an interface function based on relevant parameters of the obtained materialized view; packaging the interface function to obtain a toolkit; and in response to the modification instruction, calling an interface function of the toolkit to dynamically configure the materialized view. The materialized view is dynamically configured by calling the toolkit packaging interface function, so that the materialized view can be managed and updated more flexibly, and unnecessary influence on normal operation of the system is avoided. The interface function enables the modification of the query statement and the updating of the table structure to be more convenient, and reduces the complexity of manual operation and the risk of historical data loss at the same time. Therefore, the purpose of managing and updating the materialized view more conveniently and flexibly is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of big data, and in particular, relates to a method, an electronic device, and a program product for dynamically configuring a materialized view. Background Art

[0002] 1) Columnar database: A columnar database is a database management system that stores data in columns. Compared with a row-based database, a columnar database has better performance in processing large-scale data and is particularly suitable for the aggregation and analysis of large-scale data. The columnar database stores each column of data in an independent physical structure. In an analysis scenario, a large number of rows are often read but only a few columns are involved. In the columnar storage mode, only the columns participating in the calculation need to be read, which greatly reduces the IO cost and accelerates the query.

[0003] 2) Write amplification: An update of a record in the original row storage scenario requires updating multiple columns in the columnar storage scenario. Since columnar storage stores different columns in discontinuous spaces on the disk, random write operations on the disk are required when updating multiple columns; while in row-based storage, multiple columns of the same row are stored in continuous spaces, and a single disk write operation can complete the update.

[0004] 3) The random write efficiency of columnar storage is much lower than that of row-based storage. The high compression ratio of columnar storage will also become a disadvantage in the update scenario because when updating, the stored data needs to be decompressed, updated, compressed again, and finally written to the disk.

[0005] 4) ClickHouse is a columnar database management system that supports the function of materialized views. A materialized view is a mechanism for pre-computing and storing results, which can improve query performance and reduce the computational cost of complex queries.

[0006] 5) In ClickHouse, a materialized view is implemented by storing the result of a query in an independent table. This table contains the computed values of the query result, as well as indexes and data structures for supporting fast queries. A materialized view can be created based on the query results of a single table or multiple tables.

[0007] The prior art is the built-in materialized view function of ClickHouse. A materialized view consists of a target table, a physical table, and a materialized view Figure 3 and is composed of three parts. A materialized view is like a fixed table. The existing ClickHouse materialized views have the following problems:

[0008] 1. Influence of table structure modification: Since a materialized view is a fixed table, any modification of the table structure during the operation of any system or platform will affect the normal operation of the system.

[0009] 2. Difficult to modify query statements: If you want to modify the query statement in the materialized view, you need to manually delete the materialized view and recreate it.

[0010] 3. Troublesome manual update operation: Manually updating the materialized view requires cumbersome operations and may result in the risk of losing historical data.

[0011] 4. Lack of DML statements for directly modifying the structure of the materialized view table: Currently, ClickHouse does not have DML statements for directly modifying the structure of the materialized view table. You need to separately handle the physical table, cluster table, and materialized view to update the table structure. Summary of the Invention

[0012] In view of the problems existing in the prior art, the present invention provides a method, an electronic device, and a program product for dynamically configuring a materialized view.

[0013] In a first aspect, an embodiment of the present disclosure provides a method for dynamically configuring a materialized view, including:

[0014] Create an interface function based on obtaining relevant parameters of the materialized view;

[0015] Encapsulate the interface function to obtain a tool kit;

[0016] In response to a modification instruction, call the interface function of the tool kit to dynamically configure the materialized view.

[0017] Optionally, the interface function includes creating a materialized view, adding fields to the materialized view, deleting the materialized view, unloading the materialized view, loading the materialized view, and resetting the materialized view.

[0018] Optionally, the creating of the materialized view includes:

[0019] Create a materialized view according to the set table name and filtering conditions, and at the same time create a physical table and a cluster table, and specify the filtering conditions for data operations.

[0020] Optionally, the data operations include data filtering and data aggregation.

[0021] Optionally, the adding of fields to the materialized view includes adding new fields to the physical table and cluster table corresponding to the existing materialized view by calling the interface function.

[0022] Optionally, the deleting of the materialized view includes deleting the specified materialized view and its associated data and metadata information, and deleting the physical table and cluster table corresponding to the materialized view.

[0023] Optionally, the unloading of the materialized view includes unloading the materialized view from the cluster, but retaining the materialized view definition and metadata information;

[0024] The described loading of the materialized view includes reloading the unloaded materialized view into the cluster.

[0025] Optionally, the resetting of the materialized view includes unloading the cluster table and the materialized view, reloading a new materialized view using the added materialized view fields, and recreating the cluster table based on the physical table corresponding to the new materialized view, thereby updating the materialized view.

[0026] In a second aspect, an embodiment of the present disclosure further provides an electronic device, which includes:

[0027] At least one processor; and,

[0028] A memory communicatively connected to the at least one processor; wherein,

[0029] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for dynamically configuring a materialized view according to any one of the first aspects.

[0030] In a third aspect, an embodiment of the present disclosure further provides a computer program product, including computer programs / instructions, and when the computer programs / instructions are executed by a processor, the method for dynamically configuring a materialized view according to any one of the first aspects is implemented.

[0031] The method, electronic device, and program product for dynamically configuring a materialized view provided by the present invention. Among them, the method for dynamically configuring a materialized view can more flexibly manage and update the materialized view by calling the toolkit encapsulation interface function, avoiding unnecessary impacts on the normal operation of the system. The interface function makes it more convenient to modify query statements and update table structures, while reducing the complexity of manual operations and the risk of historical data loss. Thus, the purpose of more convenient and flexible management and update of the materialized view is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] By describing the exemplary embodiments of the present disclosure in more detail in conjunction with the drawings, the above and other objects, features, and advantages of the present disclosure will become more obvious. Among them, in the exemplary embodiments of the present disclosure, the same reference numerals generally represent the same components.

[0033] Figure 1 It is a category principle block diagram of the method for dynamically configuring a materialized view provided by the embodiment of the present disclosure;

[0034] Figure 2 It is a flowchart for creating a materialized view provided by the embodiment of the present disclosure;

[0035] Figure 3Flowchart of adding materialized view fields provided by an embodiment of the present disclosure;

[0036] Figure 4 Flowchart of deleting materialized view provided by an embodiment of the present disclosure;

[0037] Figure 5 Flowchart of unloading materialized view provided by an embodiment of the present disclosure;

[0038] Figure 6 Flowchart of loading materialized view provided by an embodiment of the present disclosure;

[0039] Figure 7 Flowchart of resetting materialized view provided by an embodiment of the present disclosure;

[0040] Figure 8 Principle block diagram of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners

[0041] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0042] It should be clear that the embodiments of the present disclosure are described by specific specific examples below. Those skilled in the art can easily understand other advantages and effects of the present disclosure from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. The present disclosure can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present disclosure without creative efforts belong to the scope of protection of the present disclosure.

[0043] It should be noted that the following describes various aspects of embodiments within the scope of the appended claims. It should be obvious that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is illustrative only. Based on the present disclosure, those skilled in the art should understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement the device and / or practice the method. In addition, this device can be implemented and this method can be practiced using other structures and / or functions in addition to one or more of the aspects described herein.

[0044] It should also be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present disclosure schematically. The diagrams only show the components related to the present disclosure, rather than being drawn according to the number, shape, and size of the components in actual implementation. The type, quantity, and ratio of each component in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.

[0045] In addition, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the described aspects can be practiced without these specific details.

[0046] In ClickHouse, the following syntax can be used to create a materialized view:

[0047] CREATE MATERIALIZED VIEW [IF NOT EXISTS] [db.]name;

[0048] [ENGINE = engine];

[0049] [POPULATE [ON CLUSTER cluster] [AS SELECT select_query] [WITH [NO] MATERIALIZED]];

[0050] [AS select_query];

[0051] [ORDER BY expr];

[0052] [SETTINGS name = value,...];

[0053] Among them, the meanings of the keywords and parameters are as follows:

[0054] CREATE MATERIALIZED VIEW: The syntax for creating a materialized view.

[0055] IF NOT EXISTS (optional): If the materialized view already exists, a new materialized view will not be created.

[0056] [db.]name: The name of the materialized view. The database to which it belongs can be specified optionally.

[0057] ENGINE = engine (optional): Specifies the storage engine of the materialized view. If not specified, the MergeTree engine is used by default.

[0058] POPULATE (optional): An option to perform data population immediately after creating the materialized view.

[0059] ON CLUSTER cluster (optional): Specifies the cluster used to populate the materialized view.

[0060] AS SELECT select_query (optional): The query statement used to define the materialized view.

[0061] WITH [NO]MATERIALIZED (optional): Specifies whether to use a materialized log when populating the materialized view. By default, a materialized log is used to improve the population performance.

[0062] ORDER BY expr (optional): Specifies the sorting expression for the materialized view.

[0063] SETTINGS name=value,... (optional): Specifies additional setting parameters for the materialized view.

[0064] After creating a materialized view, you can use ordinary SELECT statements to query the data in the materialized view.

[0065] At the same time, you can also use the ALTER MATERIALIZED VIEW statement to modify the definition, refresh strategy, and other properties of the materialized view.

[0066] Note that materialized views exist as tables in ClickHouse, so you can use table-related operations and syntax to manage and operate on materialized views.

[0067] The materialized views in ClickHouse have certain complexities in terms of operations such as modifying and updating query statements. First of all, the materialized views in ClickHouse are not as flexible as views in traditional relational databases. In ClickHouse, operations for modifying and updating materialized views are subject to more restrictions. For modifying query statements, the definition and dependency relationships of the materialized views need to be considered. If the structure or data of the base table is modified, it may affect the accuracy and availability of the materialized view. In terms of update operations, ClickHouse's materialized views generally do not support direct update operations. If data needs to be updated, it may be necessary to recreate the materialized view or perform complex data processing operations to achieve this. For example, if there are significant changes in the data in the base table, it may be necessary to delete and recreate the materialized view to reflect these changes. This may involve recalculating and storing a large amount of data, consuming more system resources and time. In addition, when dealing with multiple related materialized views, changing one view may have a cascading effect on other views that depend on it, and this dependency relationship needs to be carefully evaluated and managed. Generally speaking, handling the modification and update operations of query statements for materialized views in ClickHouse requires an in-depth understanding of its architecture and working principles, and careful planning and execution to avoid problems such as data inconsistency or performance degradation.

[0068] This embodiment discloses a method for dynamically configuring a materialized view, including:

[0069] Create an interface function based on obtaining relevant parameters of the materialized view; the relevant parameters include view name, filtering conditions, expiration time, field name, or field type, etc.

[0070] Package the interface function to obtain a toolkit;

[0071] In response to a modification instruction, call the interface function of the toolkit to dynamically configure the materialized view.

[0072] Optionally, the interface function includes creating a materialized view, adding fields to a materialized view, deleting a materialized view, unloading a materialized view, loading a materialized view, and resetting a materialized view.

[0073] Optionally, the creating of the materialized view includes:

[0074] Create a materialized view according to the set table name and filtering conditions, and at the same time create a physical table and a cluster table, and specify the filtering conditions for data operations.

[0075] Optionally, the data operations include data filtering and data aggregation.

[0076] Optionally, adding materialized view fields includes adding new fields to the physical table and cluster table corresponding to the existing materialized view by calling interface functions.

[0077] Optionally, deleting a materialized view includes deleting the specified materialized view and its associated data and metadata information, and deleting the physical table and cluster table corresponding to the materialized view.

[0078] Optionally, unloading a materialized view includes unloading the materialized view from the cluster while retaining the materialized view definition and metadata information;

[0079] Loading the materialized view includes reloading the unloaded materialized view into the cluster.

[0080] Optionally, resetting the materialized view includes unloading the cluster table and the materialized view, reloading a new materialized view using the added materialized view fields, and recreating the cluster table based on the physical table corresponding to the new materialized view, thereby updating the materialized view.

[0081] In a specific application scenario, in this embodiment, an SDK written in Java is used to encapsulate the interface for dynamic update of the materialized view. This SDK provides interface functions such as create, delete, unload, load, and add fields. By encapsulating and combining the native DML, the effect of updating the materialized view with one key is achieved.

[0082] As Figure 1 shown, the method for dynamically configuring ClickHouse materialized views covers six functional methods: creating, adding fields, deleting, unloading, loading, and resetting materialized views. The six functions in this embodiment are only for illustration and do not limit to six. The types of functions can be increased or deleted according to actual needs.

[0083] As Figure 2 shown, creating a materialized view:

[0084] Function name: createMaterializedView();

[0085] Parameters: view name, filtering conditions, expiration time, etc.;

[0086] Function: Create a materialized view based on the given table name and filtering conditions, create a physical table and a cluster table at the same time, and can specify filtering conditions for data filtering and aggregation operations.

[0087] As Figure 3 shown, adding materialized view fields:

[0088] Function name: alterMaterializedViewAddColumn();

[0089] Parameters: view name, field name, field type, etc.;

[0090] Function: Add new fields to the physical table and cluster table corresponding to the existing materialized view. Note that it is difficult to add fields to the materialized view itself, and the sixth reset method needs to be called to update the materialized view.

[0091] As Figure 4 shown, deleting a materialized view:

[0092] Function name: dropMaterializedView();

[0093] Parameters: view name;

[0094] Function: Delete the specified materialized view and its associated data and metadata information, and uniformly delete the corresponding physical table and cluster table.

[0095] As Figure 5 shown, unloading a materialized view:

[0096] Function name: detachMaterializedView();

[0097] Parameters: view name;

[0098] Function: Unload the materialized view from the ClickHouse cluster, but retain its definition and metadata information.

[0099] As Figure 6 shown, loading a materialized view:

[0100] Function name: attachMaterializedView();

[0101] Parameters: view name;

[0102] Function: Reload the unloaded materialized view into the ClickHouse cluster to make it available.

[0103] As Figure 7 shown, resetting a materialized view:

[0104] Function name: resetTable()

[0105] Parameters: view name

[0106] Function: First unload the cluster table and the materialized view, cooperate with the function of adding fields to the physical table, reload the new materialized view, and recreate the cluster table according to the physical table to achieve the purpose of updating the materialized view.

[0107] The function method of this embodiment can be called and combined according to specific requirements and business scenarios to achieve the purpose of dynamically configuring ClickHouse materialized views. The specific function call syntax and usage may vary according to the ClickHouse version and specific implementation details.

[0108] In this embodiment, the materialized view is updated through an interface function, which is faster than manual modification and only modifies the materialized view without modifying the corresponding data, so it does not affect the operation of the system.

[0109] The method for dynamically configuring materialized views disclosed in this embodiment has the following advantages:

[0110] 1. Dynamically update materialized views: Six functions are provided through the SDK method, enabling users to dynamically update ClickHouse materialized views.

[0111] 2. Flexibility and real-time performance: By providing functions for dynamically updating materialized views, users can update materialized views in real time according to needs without manually rebuilding or reloading the views. Higher flexibility and real-time performance are provided, enabling users to respond to data changes faster.

[0112] 3. Simplify management and maintenance: Traditional materialized views need to be manually managed and maintained, including operations such as creation, deletion, loading, and unloading. This embodiment simplifies the management and maintenance process of materialized views by providing function methods, reducing the workload and error probability of manual operations.

[0113] 4. Improve efficiency and performance: Dynamically updating materialized views can reduce the reconstruction and loading time of materialized views, thereby improving query performance and overall system efficiency. Users can select an appropriate update timing according to the frequency of data changes to minimize query latency.

[0114] 5. Data consistency: By dynamically updating materialized views, it can ensure that the data of materialized views is consistent with the data of the base table. When the data of the base table changes, users can immediately update the materialized view to ensure the accuracy and consistency of query results.

[0115] The electronic device disclosed in this embodiment includes a memory and a processor. The memory is used to store non-temporary computer-readable instructions. Specifically, the memory may include one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory, etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.

[0116] The processor can be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and can control other components in the electronic device to perform desired functions. In one embodiment of the present disclosure, the processor is used to run the computer-readable instructions stored in the memory, so that the electronic device executes all or part of the steps of the method for dynamically configuring a materialized view in the various embodiments of the present disclosure described above.

[0117] Those skilled in the art should understand that, in order to solve the technical problem of how to obtain a good user experience effect, this embodiment may also include well-known structures such as communication buses, interfaces, etc., and these well-known structures should also be included in the protection scope of the present disclosure.

[0118] Such as Figure 8 FIG. [FIG. number] is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. It shows a schematic structural diagram of an electronic device suitable for implementing the electronic device in the embodiments of the present disclosure. Figure 8 The shown electronic device is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.

[0119] Such as Figure 8 As shown, the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device into a random access memory (RAM). In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, the ROM, and the RAM are connected to each other through a bus. An input / output (I / O) interface is also connected to the bus.

[0120] Generally, the following devices may be connected to the I / O interface: an input device including, for example, a sensor or a visual information acquisition device; an output device including, for example, a display screen; a storage device including, for example, a magnetic tape, a hard disk, etc.; and a communication device. The communication device may allow the electronic device to communicate with other devices (such as edge computing devices) wirelessly or wiredly to exchange data. Although Figure 8 the shown electronic device has various devices, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.

[0121] In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program code for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, all or part of the steps of the method for dynamically configuring a materialized view according to an embodiment of the present disclosure are performed.

[0122] For a detailed description of this embodiment, reference may be made to the corresponding descriptions in the foregoing embodiments, and details will not be repeated here.

[0123] The computer-readable storage medium disclosed in this embodiment stores non-temporary computer-readable instructions. When the non-temporary computer-readable instructions are run by a processor, all or part of the steps of the method for dynamically configuring a materialized view according to the foregoing embodiments of the present disclosure are performed.

[0124] The above computer-readable storage media include, but are not limited to: optical storage media (such as CD-ROMs and DVDs), magneto-optical storage media (such as MOs), magnetic storage media (such as magnetic tapes or external hard drives), media with built-in rewritable non-volatile memories (such as memory cards), and media with built-in ROMs (such as ROM cartridges).

[0125] For a detailed description of this embodiment, reference may be made to the corresponding descriptions in the foregoing embodiments, and details will not be repeated here.

[0126] The basic principles of the present disclosure have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, benefits, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, benefits, effects, etc. are essential for each embodiment of the present disclosure. In addition, the above-disclosed specific details are only for illustrative and easy-to-understand purposes, and not for limitation. The above details do not limit the present disclosure to necessarily adopt the above specific details for implementation.

[0127] In this disclosure, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and do not intend to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open-ended terms, meaning "including but not limited to", and can be used interchangeably with each other. The words "or" and "and" used herein refer to the term "and / or" and can be used interchangeably with it, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to" and can be used interchangeably with it.

[0128] In addition, as used herein, the "or" used in the listing of items starting with "at least one" indicates a disjunctive listing. So, for example, the listing of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Further, the term "exemplary" does not mean that the examples described are preferred or better than other examples.

[0129] It should also be noted that in the systems and methods of this disclosure, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent solutions of this disclosure.

[0130] Various changes, substitutions, and alterations to the technologies described herein can be made without departing from the teachings defined by the appended claims. In addition, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of events, means, methods, and acts described above. Current or later-developed processes, machines, manufactures, compositions of events, means, methods, or acts that perform substantially the same function or achieve substantially the same result as the corresponding aspects described herein can be utilized. Thus, the appended claims include such processes, machines, manufactures, compositions of events, means, methods, or acts within their scope.

[0131] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects are very obvious to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.

[0132] The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the present disclosure to the form disclosed herein. Although several example aspects and embodiments have been discussed above, those skilled in the art will recognize some variations, modifications, alterations, additions, and sub-combinations thereof.

Claims

1. A method for dynamically configuring a materialized view, characterized in that Including: Create an interface function based on the relevant parameters for obtaining the materialized view; Encapsulate the interface function to obtain a toolkit; In response to a modification instruction, call the interface function of the toolkit to dynamically configure the materialized view.

2. The method for dynamically configuring a materialized view according to claim 1, wherein The interface function includes creating a materialized view, adding materialized view fields, deleting a materialized view, unloading a materialized view, loading a materialized view, and resetting a materialized view.

3. The method for dynamically configuring a materialized view according to claim 2, wherein The creation of the materialized view includes: Create a materialized view according to the set table name and filtering conditions, and at the same time create a physical table and a cluster table, and specify the filtering conditions for data operations.

4. The method for dynamically configuring a materialized view according to claim 3, wherein The data operations include data filtering and data aggregation.

5. The method for dynamically configuring a materialized view according to claim 2, wherein The addition of materialized view fields includes adding new fields to the physical table and cluster table corresponding to the existing materialized view by calling the interface function.

6. The method for dynamically configuring a materialized view according to claim 2, wherein The deletion of the materialized view includes deleting the specified materialized view and its associated data and metadata information, and deleting the physical table and cluster table corresponding to the materialized view.

7. The method for dynamically configuring a materialized view according to claim 2, wherein The unloading of the materialized view includes unloading the materialized view from the cluster, but retaining the materialized view definition and metadata information; The loading of the materialized view includes reloading the unloaded materialized view into the cluster.

8. The method for dynamically configuring a materialized view according to claim 2, wherein The resetting of the materialized view includes unloading the cluster table and the materialized view, reloading the new materialized view using the added materialized view fields, and recreating the cluster table according to the physical table corresponding to the new materialized view, so as to update the materialized view.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for dynamically configuring a materialized view according to any one of claims 1-8.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the method for dynamically configuring a materialized view according to any one of claims 1-8.