1. A method comprising: populating in volatile memory, at least one table of two tables, based on a partition key; receiving a query that joins the two tables on a join key that is the same as the partition key; based on the query received, determining validity of using full or partial partition-wise join for the query; based on how the two tables are populated in-memory, generating a first cost estimate for a first query execution plan of a plurality of query execution plans that divides the query that joins the two tables into a plurality of partition-to-partition joins, each partition-to-partition join, of the plurality of partition-to-partition joins, between a pair of corresponding partitions from the two tables; generating a second cost estimate for a second query execution plan of the plurality of query execution plans that divides the query into a plurality of slave processes for an in-memory scanning operation of at least one of the two tables and a join operation on individual portions the of the two tables; and based on a lowest cost estimate of at least the first cost estimate and the second cost estimate, selecting a particular query execution plan among the plurality of query execution plans; wherein the method is performed on one or more computing devices.