What I'm assuming here is that the browser made a request, and is sitting there waiting for a response. During that wait, your SQL query is running.
in reply to CGI::Push Only Works With Netscape. Now What?
If thats the case -- perhaps you could send the browser, say, and HTML comment.. or something else trivial, which won't affect the display, but allow the browser to know something is still going on, and that it shouldn't time out. You can just set up some sort of loop, or even use the alarm function, and have your script send something to the browser every 10 seconds or so