[Zope] Problems with *BIG* SQL queries

tom smith tom@othermedia.com
Sun, 18 Mar 2001 20:11:10 +0000


on 18/3/01 3:16 PM, Mayers, Philip J at p.mayers@ic.ac.uk wrote:

> I've got some problems performing and returning some large SQL queries in
> our Zope app. The queries are reasonably quick if done straight to the SQL
> server, and return about 3000 to 5000 rows - the resulting HTML (generated
> with a dtml-in over the results) is about 600-900kbytes.
> 
> But, the queries seem to take a *long* time - Zope is spinning at about 60%
> CPU in the thread responsible for sending the HTTP request back. Why? I've
> just timed it at 1:30 for 3914 rows and 586kb of HTML.

Put simply, your page is abnormally big (32k is the "standard" for a page if
you listen to Linda Weisman), it's taking the browser and age to render it.

 You may want to look into using less html (relative pathnames) and style
sheets to try and get the overall size of your page down. (Also, put more
RAM in the client machines:-)

Are you also using lots of embedded tables?  That'll slow the browser down
considerably too. 

You could also consider using the Xron product to schedule a (once a
minute/hour) pythonscript which writes it out to a html file. That way, at
least nothing is dynamic. You could also consider writing out to PDF and
mailing to your clients (mad but it depends on the information)

hope these ideas help

tom