A method and system and apparatus for stream aggregation in a database

By establishing mapping relationships and dynamically replacing query plans in the openGauss database, streaming aggregation functionality was implemented, solving the problem that openGauss does not support multi-stage aggregation, and achieving efficient streaming aggregation computation and real-time data processing.

CN122364273APending Publication Date: 2026-07-10广州海量数据库技术有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-07
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

The existing openGauss database does not support multi-stage aggregation mechanisms, which makes it impossible to directly port streaming aggregation plugins and meet the needs of real-time data processing. Furthermore, existing solutions cannot guarantee low latency and continuous computing capabilities in streaming computing scenarios.

Method used

By establishing a mapping relationship between the original aggregation function and the preliminary aggregation function, the merged aggregation function, and the final calculation function in the openGauss database, and dynamically replacing the query plan using a plug-in approach, streaming aggregation functionality is achieved. This includes creating a materialized table to store intermediate states and performing multi-stage splitting and replacement of functions during data writing and querying.

Benefits of technology

Without modifying the database kernel, streaming aggregation functionality is implemented, reducing deployment difficulty and maintenance costs, supporting efficient incremental computing, reducing storage overhead, and maintaining the transparency and ease of use of streaming view queries, while possessing good compatibility and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122364273A_ABST
    Figure CN122364273A_ABST
Patent Text Reader

Abstract

This invention relates to the field of database management technology, providing a streaming aggregation method, system, and device in a database. The method includes: establishing a mapping relationship in the database; responding to a user creating a streaming view containing aggregation operations, determining the corresponding final calculation function based on the mapping relationship, and creating a materialized table for storing intermediate aggregation states; rewriting the streaming view as a query that executes the final calculation function on the materialized table; responding to data being written to the streaming table, generating a first query plan based on the original query of the streaming view, generating a second query plan and a third query plan based on the mapping relationship, and executing them sequentially to first obtain the intermediate states of the current write operation, then merging the current write intermediate states with the existing intermediate states in the materialized table and updating the materialized table; responding to a user querying the streaming view, executing the rewritten streaming view, obtaining and returning the aggregation result. This invention can fully implement streaming aggregation functionality without modifying the database kernel.
Need to check novelty before this filing date? Find Prior Art

Citation Information

Patent Citations

  • Intermediate result storage and transparent replacement method and device for asynchronous materialized view and electronic equipment

    CN120179692A