I have a query like this:
Select PATH
from FOLDER
where ...
This query return a list of path. (for example, 600 string).
When I use this list of path and do another request later with
Select *
From FOLDER
WHERE FOLDER.PATH IN ('path1','path2' [...])
it could take more than 30 seconds.
When I do this query:
Select *
From FOLDER
WHERE
FOLDER.PATH IN (Select PATH
from FOLDER
where
...)
It take less than 1 second.
Is sql server perform the query and make Join ?
In this case, why on this post they advise to change the query with a JOIN?