Interchanging the order of grouping and join

dc.contributor.authorYan, Weipeng P.
dc.contributor.authorLarson, Per-Ake
dc.date.accessioned2026-11-24T21:06:34Z
dc.date.issued1995-02
dc.description.abstractAssume that we have an SQL query containing joins, a GROUP-BY and possibly a HAVING predicate. The standard way of evaluating this type of query is to first perform the group-by early, that is to push the group-by operation past one or more joins. This may reduce the query processing cost by reducing the amount of data participating in joins. The reverse transformation, i.e., performing join before group-by, can also be beneficial because the join may greatly reduce the input to the group-by. We formally define the problem, adhering strictly to the semantics of SQL2, and prove necessary and sufficient conditions for deciding when the transformation is valid. In practice, it may be expensive or even impossible to test whether the conditions are satisfied. Therefore, we also present a more practical algorithm that tests a simpler, sufficient conditino. This algorithm is fast and detects a large subclass of transformable queries.
dc.identifier.urihttps://hdl.handle.net/10012/24752
dc.language.isoen
dc.publisherUniversity of Waterloo
dc.relation.ispartofseriesComputer Science Technical Reports; CS-95-09
dc.titleInterchanging the order of grouping and join
dc.typeTechnical Report
uws.contributor.affiliation1Faculty of Mathematics
uws.contributor.affiliation2David R. Cheriton School of Computer Science
uws.peerReviewStatusUnreviewed
uws.scholarLevelFaculty
uws.typeOfResourceTexten

Files

Original bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
groupby.pdf
Size:
451.75 KB
Format:
Adobe Portable Document Format

License bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
license.txt
Size:
4.47 KB
Format:
Item-specific license agreed upon to submission
Description: