The order in which the query statements are executed depends on the following clauses:
1.from clauses: The order of execution is from backward, right to left
A table with a small amount of data is kept as far back as possible
2.where clauses: The execution order is bottom-up, right-to-left
Writes the criteria that can filter out the maximum number of records to the right of the WHERE clause
3.group by--The execution sequence is grouped from left to right
It is best to use where before group by to filter out unwanted records before group by
4.HAVING clause: Consuming resources
Try to avoid using it, having the result set filtered after all records have been retrieved, ordered, etc.
5.select clause: Use less * and take field names as much as possible.
During the parsing process, Oracle converts the * number to all column names by querying the data dictionary, which consumes time
6.order BY clause: Order of execution from left to right, consuming resources
Query Statement Execution order