Indexed columns take precedence, there are indexes to see the amount of data to be queried, less priority
In, not in,<>,is null,is NOT NULL, etc. as the index does not go, try not to use.
The condition order after the WHERE clause has a direct effect on the query of the large data scale, such as
Select * from zl_yhjbqk where dy_dj = ' 1K or less ' and xh_bz=1
Select * from Zl_yhjbqk where xh_bz=1 and dy_dj = ' 1K or less '
The above two SQL Dy_dj and xh_bz two fields are not indexed, so the execution is full table scan, the first SQL DY_DJ = ' 1KV below ' condition in the recordset ratio of 99%, and xh_bz=1 ratio is only 0.5%, at the time of the first SQL 99 The% records are compared DY_DJ and xh_bz, while in the second SQL 0.5% records are compared Dy_dj and xh_bz, in order to conclude that the second SQL CPU utilization is significantly lower than the first one.
SQL query efficiency WHERE statement condition