The invention relates to a method for realizing optimization of a
data source extensive makeup language (
XML) query
system based on sub-queries. The method comprises the following steps: receiving corresponding
XML query input information; carrying out
morphological analysis and syntactic analysis, and verifying the
correctness and the validity; if the analysis is successful and the
verification is passed, generating an
XML analytical
syntactic tree; translating the XML analytical
syntactic tree, and converting the XML query input information into intermediate
logical representation; carrying out
rewriting treatment, and generating a target query expression; and calling supported querying and computing engines for querying and computing, and acquiring output query results. By adopting the method for realizing the optimization of the
data source XML query
system based on the sub-queries, the
query rewriting can be used for converting a procedural query into a descriptive query, the sub-queries are optimized, and certain specific sub-queries are rewritten into equivalent attended operation of a plurality of tables by the combination of the sub-queries, thus the levels of query sentences are reduced as much as possible, the treatment of planning optimization can be carried out conveniently, and the method has stable and reliable working performance and wider application range.