Techniques to detect incorrect queries exist only for a subset of relational calculus. Second, the normalized query is analyzed semantically so that incorrect queries are detected and rejected as early as possible. Normalization of a query generally involves the manipulation of the query quantifiers and of the query qualification by applying logical operator priority. First, the calculus query is rewritten in a normalized form that is suitable for subsequent manipulation. Query decomposition can be viewed as four successive steps. Thus the techniques used by this layer are those of a centralized DBMS. However, the information about data distribution is not used here but in the next layer. The information needed for this transformation is found in the global conceptual schema describing the global relations.
The first layer decomposes the calculus query into an algebraic query on global relations. It is done by the local sites and the control site. The fourth layer performs distributed query execution by executing the plan and returns the answer to the query. The first three layers are performed by a central control site and use schema information stored in the global directory. Query decomposition and data localization correspond to query rewriting. They perform the functions of query decomposition, data localization, and global query optimization. The first three layers map the input query into an optimized distributed query execution plan. Four main layers are involved in distributed query processing. This query is posed on global (distributed) relations, meaning that data distribution is hidden. The input is a query on global data expressed in relational calculus. A generic layering scheme for query processing is shown where each layer solves a well-defined sub-problem. The problem of query processing can itself be decomposed into several sub-problems, corresponding to various layers.