Hi, I need some help with a query with 2 layers of nested sub-query. Here's an outline of the query. Problem is each nested query takes < 15 mins to run when run individually but when executed together the query takes a few hours! Any ideas how to improve query performance?

(outer query
(nested query 1 -- derives columns a,b
(nested query 1-1)
(nested query 1-2)
) nq1,
(nested query 2 -- derives columns c,d
(nested query 2-1)
(nested query 2-2)
) nq2,
table1,
table2
) oq1