14. A computer program product for optimizing a query statement in a relational database, the computer program product comprising a non-transitory computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to perform a method comprising: determining filtering performance for each of at least two complex predicates in a predetermined layer in a set of predetermined layers of the query statement based on a result of a query performed on predetermined data records by using only the at least two complex predicates in the predetermined layer; re-ordering the complex predicates in the predetermined layer based on the filtering performance so as to rank a complex predicate with higher filtering performance before a complex predicate with lower filtering performance, wherein said re-ordering the complex predicates in the predetermined layer comprises: determining a number of elements having the value of 1 for each N-variable row vector; re-ordering the complex predicates in the predetermined layer based on the number of the elements having the value of 1 in respective N-variable row vectors, according to the predicate conjunction between the complex predicates in the predetermined layer; and wherein the filtering performance is ranked based upon a predicate conjunction; determining the filtering performance for a compound predicate comprising the respective predicates in the predetermined layer and conjunctions joining the respective predicates; wherein said determining filtering performance for each of the complex predicates comprises: determining sequence numbers of the data records obtained by performing a query using the complex predicate; creating a N-variable row vector corresponding to the complex predicate to represent the filtering performance of the complex predicate, wherein N is the number of the predetermined data records, elements in the row vector at positions corresponding to the sequence numbers of the data records obtained by performing the query have a value 1, and elements at other positions have a value 0; creating corresponding N-variable row vectors for respective predicates in the predetermined layer for which the filtering performance has not been determined; and performing logical operation represented by the predicate conjunction for the corresponding N-variable row vectors of the predicates in the predetermined layer one element by one element, so as to obtain an intermediate N-variable row vector representing the filtering performance of the compound predicate.
14. A computer program product for optimizing a query statement in a relational database, the computer program product comprising a non-transitory computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to perform a method comprising: determining filtering performance for each of at least two complex predicates in a predetermined layer in a set of predetermined layers of the query statement based on a result of a query performed on predetermined data records by using only the at least two complex predicates in the predetermined layer; re-ordering the complex predicates in the predetermined layer based on the filtering performance so as to rank a complex predicate with higher filtering performance before a complex predicate with lower filtering performance, wherein said re-ordering the complex predicates in the predetermined layer comprises: determining a number of elements having the value of 1 for each N-variable row vector; re-ordering the complex predicates in the predetermined layer based on the number of the elements having the value of 1 in respective N-variable row vectors, according to the predicate conjunction between the complex predicates in the predetermined layer; and wherein the filtering performance is ranked based upon a predicate conjunction; determining the filtering performance for a compound predicate comprising the respective predicates in the predetermined layer and conjunctions joining the respective predicates; wherein said determining filtering performance for each of the complex predicates comprises: determining sequence numbers of the data records obtained by performing a query using the complex predicate; creating a N-variable row vector corresponding to the complex predicate to represent the filtering performance of the complex predicate, wherein N is the number of the predetermined data records, elements in the row vector at positions corresponding to the sequence numbers of the data records obtained by performing the query have a value 1, and elements at other positions have a value 0; creating corresponding N-variable row vectors for respective predicates in the predetermined layer for which the filtering performance has not been determined; and performing logical operation represented by the predicate conjunction for the corresponding N-variable row vectors of the predicates in the predetermined layer one element by one element, so as to obtain an intermediate N-variable row vector representing the filtering performance of the compound predicate. 15. The computer program product according to claim 14 , wherein said determining the filtering performance for each of the complex predicates comprises: determining a number of data records obtained by performing a query using only the complex predicate; and calculating a filter factor for the complex predicate based on the number of the data records obtained by performing the query.