Are you on your own server or is this a shared server? If you have access to something like phpmyadmin you can look at the mysql processlist to see if mysql is actually doing anything at all during the time the page is hanging.

It could be a PHP timelimit being reached as well. Many servers have this set to something like 30 seconds, and if the PHP script doesn't finish in that amount of time, then it will stop. If it's your own server then you could edit the php.ini file to change the max_execution_time to something higher to see if that helps.