Mella, EduardoRodríguez, M. AndreaBravo, LoretoGatica, Diego2020-10-302020-10-302019Geoinformatica (2019) 23: 79–104https://doi.org/10.1007/s10707-018-00335-whttp://hdl.handle.net/11447/3502Query processing is an important challenge for spatial databases due to the use of complex data types that represent spatial attributes. In particular, due to the cost of spatial joins, several optimization algorithms based on indexing structures exist. The work in this paper proposes a strategy for semantic query optimization of spatial join queries. The strategy detects queries with empty results and rewrites queries to eliminate unnecessary spatial joins or to replace spatial by thematic joins. This is done automatically by analyzing the semantics imposed by the database schema through topological dependencies and topological referential integrity constraints. In this way, the strategy comes to complement current state-of-art algorithms for processing spatial join queries. The experimental evaluation with real data sets shows that the optimization strategy can achieve a decrease in the time cost of a join query using indexing structures in a spatial database management system (SDBMS).26 p.enSpatial databasesSemantic optimizationSpatial query rewritingSpatial integrity constraintsQuery rewriting for semantic query optimization in spatial databasesArticle