1. A non-transitory computer program product storing instructions that, when executed by at least one programmable processor forming part of at least one computing system, cause the at least one programmable processor to perform operations comprising: receiving a query request comprising a definition of a query of a database persisted in a column-based in-memory storage; identifying a pattern in at least part of the query; matching the identified pattern with a plurality of matching patterns among a set of pre-defined patterns, each of the pre-defined patterns having associated therewith at least one pre-compiled query execution sub-component of a plurality of pre-compiled query execution sub-components retained in a library, and wherein the matching includes selecting a selected matched pattern from among the plurality of matching patterns; selecting, based on the matching of the identified patterns with the plurality of matching-patterns, an optimal sequence for processing a plurality of tables that must be joined to respond to the query that avoids intermediate results and allows for the query to be performed in a single pass of the database, wherein at least one matching pattern other than the selected matched pattern produces intermediate results and requires more than two passes of the database; generating a plan for executing the query, the generating comprising incorporating the pre-compiled query execution sub-component associated with the selected matched pattern into the plan based on a pseudo code representation of the plan derived from the definition; and executing the query using the generated plan; and configuring the plan to include the optimal sequence for processing the plurality of tables; wherein the pseudo code is pre-prepared, pre-compiled, and stored in a library.