From: Dan Bracuk on
40 minutes is huge for a query. What you want to do is:

1. Ask yourself why it takes so long.
2. Figure out a way to run it without making the user wait.

cfthread is not your answer.