Can you try with a preceeding WITH clause? It can also be forced to materialize. Maybe this can help.