A solution for synchronous incremental maintenance of materialized views based on SQL recursive query
Materialized views are excessively stored query execution results in the database. They can be used to partially or completely answer queries which will be further appeared instead of re-executing query from the scratch. There is a large number of published works that address the maintenance, especi...
Main Authors: | , , , , , |
---|---|
Format: | Article |
Language: | English |
Published: |
PC Technology Center
2019-10-01
|
Series: | Eastern-European Journal of Enterprise Technologies |
Subjects: | |
Online Access: | http://journals.uran.ua/eejet/article/view/180226 |
id |
doaj-4f5582e42ba843298849a19295a6c77c |
---|---|
record_format |
Article |
spelling |
doaj-4f5582e42ba843298849a19295a6c77c2020-11-25T00:13:22ZengPC Technology CenterEastern-European Journal of Enterprise Technologies1729-37741729-40612019-10-0152 (101)61710.15587/1729-4061.2019.180226180226A solution for synchronous incremental maintenance of materialized views based on SQL recursive queryNguyen Tran Quoc Vinh0Dang Thanh Hao1Pham Duong Thu Hang2Abeer Alsadoon3PW Chandana Prasad4Nguyen Viet Anh5The University of Da Nang – University of Science and Education Ton Duc Thang, 459, Lien Chieu Dist., Da Nang city, Vietnam, 550000The University of Da Nang – University of Science and Education Ton Duc Thang, 459, Lien Chieu Dist., Da Nang city, Vietnam, 550000The University of Da Nang – University of Science and Education Ton Duc Thang, 459, Lien Chieu Dist., Da Nang city, Vietnam, 550000Charles Sturt University Level 1, Oxford str., 63, Darlinghurst NSW 2010, AustraliaCharles Sturt University Level 1, 63 Oxford str., Darlinghurst NSW 2010, AustraliaVietnam Academy of Science and Technology Hoang Quoc Viet, 108, Cau Giay Dist., Hanoi City, Vietnam, 100000Materialized views are excessively stored query execution results in the database. They can be used to partially or completely answer queries which will be further appeared instead of re-executing query from the scratch. There is a large number of published works that address the maintenance, especially incremental update, of materialized views and query rewriting for using those ones. Some of them support materialized views based on recursive query in datalog language. Although most of datalog queries can be transferred into SQL queries and vise versa but it is not the case for recursive queries. Recursive queries in the data log try to find all possible transitive closures. Recursive queries in SQL (Common Table Expression – CTE) return direct links but not transitive closures. In this paper, we propose efficient methods for incremental update of materialized views based on CTE; and then propose an algorithm for generating source codes in C language for any input SQL recursive queries. The synthesized source codes implement our proposed incremental update algorithms according to inserted/deleted/updated record set in the base tables. This paper focuses mainly on the recursive queries whose execution results are directed tree-structured data. The two cases of tree node are considered. In the first case, a child node has only one parent node and in the second case, a child node can have many parent nodes. Those two cases represent the two types of relationships between entities in real world, that are one–to–many and many–to–many, respectively. For the one–to–many relationships, the relationship data is accompanied with the records describing the child using some fields. Those fields are set as null in deleting a concrete relationship. For the many–to–many relationships, it is stored in a separate table and the concrete relationships are removed by deleting describing records from that table. Considering of enforcing referential integrity may help to reduce the searching space and therefore, help to improve the performance. However, the set of tree nodes or tree edges can be manipulated. All those combinations lead to different algorithms. The experimental results are provided and discussed to confirm the effectiveness of our proposed methodshttp://journals.uran.ua/eejet/article/view/180226materialized viewsql recursive querycteincremental updatesource code generating |
collection |
DOAJ |
language |
English |
format |
Article |
sources |
DOAJ |
author |
Nguyen Tran Quoc Vinh Dang Thanh Hao Pham Duong Thu Hang Abeer Alsadoon PW Chandana Prasad Nguyen Viet Anh |
spellingShingle |
Nguyen Tran Quoc Vinh Dang Thanh Hao Pham Duong Thu Hang Abeer Alsadoon PW Chandana Prasad Nguyen Viet Anh A solution for synchronous incremental maintenance of materialized views based on SQL recursive query Eastern-European Journal of Enterprise Technologies materialized view sql recursive query cte incremental update source code generating |
author_facet |
Nguyen Tran Quoc Vinh Dang Thanh Hao Pham Duong Thu Hang Abeer Alsadoon PW Chandana Prasad Nguyen Viet Anh |
author_sort |
Nguyen Tran Quoc Vinh |
title |
A solution for synchronous incremental maintenance of materialized views based on SQL recursive query |
title_short |
A solution for synchronous incremental maintenance of materialized views based on SQL recursive query |
title_full |
A solution for synchronous incremental maintenance of materialized views based on SQL recursive query |
title_fullStr |
A solution for synchronous incremental maintenance of materialized views based on SQL recursive query |
title_full_unstemmed |
A solution for synchronous incremental maintenance of materialized views based on SQL recursive query |
title_sort |
solution for synchronous incremental maintenance of materialized views based on sql recursive query |
publisher |
PC Technology Center |
series |
Eastern-European Journal of Enterprise Technologies |
issn |
1729-3774 1729-4061 |
publishDate |
2019-10-01 |
description |
Materialized views are excessively stored query execution results in the database. They can be used to partially or completely answer queries which will be further appeared instead of re-executing query from the scratch. There is a large number of published works that address the maintenance, especially incremental update, of materialized views and query rewriting for using those ones. Some of them support materialized views based on recursive query in datalog language. Although most of datalog queries can be transferred into SQL queries and vise versa but it is not the case for recursive queries. Recursive queries in the data log try to find all possible transitive closures. Recursive queries in SQL (Common Table Expression – CTE) return direct links but not transitive closures. In this paper, we propose efficient methods for incremental update of materialized views based on CTE; and then propose an algorithm for generating source codes in C language for any input SQL recursive queries. The synthesized source codes implement our proposed incremental update algorithms according to inserted/deleted/updated record set in the base tables. This paper focuses mainly on the recursive queries whose execution results are directed tree-structured data. The two cases of tree node are considered. In the first case, a child node has only one parent node and in the second case, a child node can have many parent nodes. Those two cases represent the two types of relationships between entities in real world, that are one–to–many and many–to–many, respectively. For the one–to–many relationships, the relationship data is accompanied with the records describing the child using some fields. Those fields are set as null in deleting a concrete relationship. For the many–to–many relationships, it is stored in a separate table and the concrete relationships are removed by deleting describing records from that table. Considering of enforcing referential integrity may help to reduce the searching space and therefore, help to improve the performance. However, the set of tree nodes or tree edges can be manipulated. All those combinations lead to different algorithms. The experimental results are provided and discussed to confirm the effectiveness of our proposed methods |
topic |
materialized view sql recursive query cte incremental update source code generating |
url |
http://journals.uran.ua/eejet/article/view/180226 |
work_keys_str_mv |
AT nguyentranquocvinh asolutionforsynchronousincrementalmaintenanceofmaterializedviewsbasedonsqlrecursivequery AT dangthanhhao asolutionforsynchronousincrementalmaintenanceofmaterializedviewsbasedonsqlrecursivequery AT phamduongthuhang asolutionforsynchronousincrementalmaintenanceofmaterializedviewsbasedonsqlrecursivequery AT abeeralsadoon asolutionforsynchronousincrementalmaintenanceofmaterializedviewsbasedonsqlrecursivequery AT pwchandanaprasad asolutionforsynchronousincrementalmaintenanceofmaterializedviewsbasedonsqlrecursivequery AT nguyenvietanh asolutionforsynchronousincrementalmaintenanceofmaterializedviewsbasedonsqlrecursivequery AT nguyentranquocvinh solutionforsynchronousincrementalmaintenanceofmaterializedviewsbasedonsqlrecursivequery AT dangthanhhao solutionforsynchronousincrementalmaintenanceofmaterializedviewsbasedonsqlrecursivequery AT phamduongthuhang solutionforsynchronousincrementalmaintenanceofmaterializedviewsbasedonsqlrecursivequery AT abeeralsadoon solutionforsynchronousincrementalmaintenanceofmaterializedviewsbasedonsqlrecursivequery AT pwchandanaprasad solutionforsynchronousincrementalmaintenanceofmaterializedviewsbasedonsqlrecursivequery AT nguyenvietanh solutionforsynchronousincrementalmaintenanceofmaterializedviewsbasedonsqlrecursivequery |
_version_ |
1725394718756438016 |