EXISTS execution order

select * from a where a.s_status=1 and exists (select orderid from b on a.orderid=b.orderid)

exists execution order

1. First exists returns true or false

2. When querying a piece of data of a, it will execute exists. If it returns true, it will exist in the result set, and then execute the next data of a until the data of a is executed.

3. How is the data in exists executed? As long as the conditions are met, it will return true, there is no need to query all the data in the b table

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325213993&siteId=291194637