1. A system for processing queries comprising: at least one processor configured to: analyze, in a column-wise relational database management system, statistical information of input data records in relation to a first operation for a query, wherein the input data records are divided into chunks having a predefined, system-wide, size, the first operation is a filtering operation that produces output groups of a smaller size than the chunks of the input data records, and the analysis comprises estimating a selectivity value that depends upon a number of output records for the first operation; set a predetermined threshold such that a performance overhead of a coalescing operation on the output groups is less than a performance cost of performing subsequent steps on the produced output groups; apply the first operation to the chunks of the input data records to produce the corresponding output groups of output data records; in response to the selectivity value being below the predetermined threshold, coalesce the output groups of the output data records to form larger output groups of the output data records for input to a subsequent second operation for the query based on the analysis; generate a plan to determine query results, wherein the plan comprises the first and second operations; and insert a coalescing operation into the plan to operate on the output groups of the output data records in response to the selectivity value being below the predetermined threshold.