A computer-implemented method for identifying a set of pre-join operations to be performed, when accessing a database of relational tables, the method comprising: collecting a sample set of queries stored in a query history log; creating a graph of weighted edges and nodes, wherein the nodes represent relational tables and the edges represent join operations to be performed on the tables, wherein each edge further including an edge weight indicative of a frequency of use and/or urgency of use of the corresponding join result in the collected sample set; partitioning the graph into a plurality of graph communities based on corresponding graph community densities, with a density of the graph community densities indicating a number of edges touching a particular node, with the number of edges being greater than a predetermined edge number threshold; and generating pre-join results based on the partitioned graph communities and graph community densities; wherein the step of generating pre-join results comprises: ordering detected graph communities in a decreasing order of graph community densities, where the graph community densities are indicative of collective frequency of referencing to members of the graph community and/or indicative of collective urgency of access to the members of the graph community; successively selecting individual graph communities in the ordered graph communities in the decreasing order of graph community densities until a capacity limit of a storage allocated for storing the pre-join results is reached, and for each selected graph community, until at least one edge is remaining in the selected graph community, iteratively performing the steps of: selecting an edge with maximum edge weight, add a corresponding join operation to a pre-join candidate list, and removing the edge from the selected graph community; sorting the pre-join candidate list in decreased order of edge weights of corresponding join operations; and successively performing individual join operations in the pre-join candidate list until the capacity limit of the storage allocated for storing the pre-join results is reached. collecting a sample set of queries stored in a query history log; creating a graph of weighted edges and nodes, wherein the nodes represent relational tables and the edges represent join operations to be performed on the tables, wherein each edge further including an edge weight indicative of a frequency of use and/or urgency of use of the corresponding join result in the collected sample set; partitioning the graph into a plurality of graph communities based on corresponding graph community densities, with a density of the graph community densities indicating a number of edges touching a particular node, with the number of edges being greater than a predetermined edge number threshold; and generating pre-join results based on the partitioned graph communities and graph community densities; ordering detected graph communities in a decreasing order of graph community densities, where the graph community densities are indicative of collective frequency of referencing to members of the graph community and/or indicative of collective urgency of access to the members of the graph community; successively selecting individual graph communities in the ordered graph communities in the decreasing order of graph community densities until a capacity limit of a storage allocated for storing the pre-join results is reached, and for each selected graph community, until at least one edge is remaining in the selected graph community, iteratively performing the steps of: selecting an edge with maximum edge weight, add a corresponding join operation to a pre-join candidate list, and removing the edge from the selected graph community; sorting the pre-join candidate list in decreased order of edge weights of corresponding join operations; and successively performing individual join operations in the pre-join candidate list until the capacity limit of the storage allocated for storing the pre-join results is reached.