A SQL query with all outer joins was causing the server to crash. This was caused by a loop that optimizes join order, which was ending with no node pair chosen when the query contained all outer joins. The logic has been changed so that the pair of nodes 0,1 is chosen as the least cardinality pair.