A tool for combining common processes shared by at least two or more sub-queries within a query is provided. The tool determines the query with the at least two or more sub-queries. The tool determines whether one or more sub set relationships are shared between the at least two or more sub-queries. Responsive to a determination that one or more sub set relationships are shared between the at least two or more sub-queries, the tool determines an order class for the at least two or more sub-queries based on the one or more sub set relationships. The tool determines an access path for the query. The tool executes the access path during run-time for data accessing.