In some cases, you might notice your Query Activities failing because of time-outs.
This occurs because, by default, Query Activities in Salesforce Marketing Cloud time out after 30 minutes as explained in the article below:
Optimize the Query Activity
You can try rerunning the Selection and it might succeed, but this will not always be the case.
A more efficient way to avoid this problem is to try to optimize your Selections. To do so, it is recommended to use Primary Keys to join your tables and in the fields used in the Data Extension in (Not) In Results filters.
In case that is still not enough, other possible solutions would be to either contact Salesforce to increase the time-out limit or split your Selection into smaller simpler ones.