So you are saying the query time is 4 minutes? How does your query look like? What is your heap size? Did you already try to debug/narrow the problem? Anything interesting?