The application relates to a SQL optimization processing method based on a relational database. The method comprises the following steps: marking whether a state transition function of an aggregation function is a monotone function in a metadata table of a relational databasesystem; pushing a filtering condition of the aggregation function into the state transition function when a query plan is generated; executing the state transition function of the aggregation function on data when the query plan is executed; substituting a result into the filtering condition; and directly processing next grouped data if the filtering condition is not satisfied. Compared with an existing processing mode, the filtering condition of the aggregation function is pushed into the state transition function of the aggregation function, records not satisfying output requirements can be found early, and the SQL execution process is accelerated. The execution time of some SQL of a database can be greatly shortened through the method, and application of the method can help to better exert the performance of the database and improve the working efficiency of the database.