I would like to clarify, if not in use in the request, it will not bring harm? Just here I somehow asked something similar and I was told that NOT IN would slow down.
If you use it normally, then fine. If not, tell me the replacement.
I would like to clarify, if not in use in the request, it will not bring harm? Just here I somehow asked something similar and I was told that NOT IN would slow down.
If you use it normally, then fine. If not, tell me the replacement.
You can try through " EXISTS ". In general, IMHO "NOT IN" should not slow down ...
UPD # 1: EXISTS returns TRUE if the subquery returns at least one row, and FALSE - if the subquery does not return any rows.
In your case, the request will be:
SELECT tid FROM tasks WHERE EXISTS(SELECT 1 FROM tasks_done WHERE id = tid) UPD # 2: here's a working example
tid FROM tasks WHERE tid EXISTS (SELECT id FROM tasks_done ) - ModaLtasks WHERE EXISTS (SELECT tdtid FROM tasks_done ) - ModaLSource: https://ru.stackoverflow.com/questions/255269/
All Articles