[Seaside] Re: Scaling Seaside apps (was: About SToR)

Richard Huxton dev at archonet.com
Fri Aug 4 06:48:04 UTC 2006


Rick Flower wrote:
> 
> I plopped a note over on the Glorp mailing list about your Cursor 
> comment (I hope you didn't mind) and got the following reply from Alan 
> Knight about what happens with Cursors & Glorp (he wanted me to post 
> this since he wasn't able to post directly) :
> 
> ==========================================================================
> If you can post, you might mention that Glorp actually does everything 
> internally in terms of cursors. If you want the result set returned only 
> part at a time, you can set the query collectionType: to 
> GlorpCursoredStream, which gives you a stream on the results. However, 
> that will then depend on the underlying driver's behaviour. I know that 
> in VW, I've seen complaints the Postgresql driver doesn't do cursors 
> very effectively - it gets all the results before returning anything. 
> Other drivers, however, certainly do do cursors.
> ==========================================================================

Hmm - I just don't believe that. OK, for certain queries you'll have to 
fetch everything (if you want a sorted list, you can't get the first 
item until you're sure it's the smallest value). However, if you ask for 
a cursor then you get a cursor. It even plans queries differently on the 
grounds that with a cursor you'll want the first row asap.

If anyone is interested in exploring Glorp and its performance with 
PostgreSQL then the pgsql-performance mailing list is a good place to 
start. I'm there much of the time as are a lot of people smarter than me.

People will want to see:
1. The problem query
2. Relevant parts of the database schema
3. output of EXPLAIN ANALYZE for the problem query
4. Assurance that VACUUM/ANALYSE are being run
5. Possibly details of hardware & what configuration changes you've made.

-- 
   Richard Huxton
   Archonet Ltd


More information about the Seaside mailing list