The SQL language allows users to express queries that have nested subqueries in them. Optimization of nested queries has received considerable attention over the last few years. Executing a query after unnesting it leads to lesser processing compared to executing it in the nested form itself. Kim's algorithm for unnesting nested queries has a COUNT bug for Join Aggregate type queries. Richard A. Ganski and U. Dayal gave general strategies to avoid the COUNT bug. M. Muralikrishna modified Kim's algorithm so that it avoids the COUNT bug. Apart from this, he proposed an integrated algorithm for generating query plans for a given input query. In this paper, we have given a solution for implementing the Kim's modified algorithm of unnesting nested queries and this also avoids the COUNT bug convincingly. We observed that the integrated algorithm holds flaws and modifications for correcting these flaws have been proposed in this paper. All existing and proposed query plans have been implemented and the experimental results have determined those query plans which are computationally better than others generated by integrated algorithm. The above merits have been incorporated into a new unnesting algorithm.
[1]
F. Ashcroft,et al.
VIII. References
,
1955
.
[2]
Umeshwar Dayal,et al.
Of Nests and Trees: A Unified Approach to Processing Queries That Contain Nested Subqueries, Aggregates, and Quantifiers
,
1987,
VLDB.
[3]
M. Muralikrishna.
Optimization and Dataflow Algorithms for Nested Tree Queries
,
1989,
VLDB.
[4]
Werner Kiessling.
SQL-like and Quel-like correlation queries with aggregates revis-ited
,
1984
.
[5]
Won Kim,et al.
On optimizing an SQL-like nested query
,
1982,
TODS.
[6]
M. Muralikrishna,et al.
Improved Unnesting Algorithms for Join Aggregate SQL Queries
,
1992,
VLDB.
[7]
Harry K. T. Wong,et al.
Optimization of nested SQL queries revisited
,
1987,
SIGMOD '87.