1. A method for generating a final result of a query of a database that is represented by an edge-labeled tree and decomposed into a plurality of separated portions, comprising: evaluating the query for each of the separated portions; generating accessibility graphs for the separated portions based on respective query evaluations, each of the accessibility graphs corresponding to one of the separated portions; combining the accessibility graphs into a single graph; identifying parts of the separated portions that contribute to the final query result based on the single graph; and generating the final query result based on identified parts of the separated portions.