On 10/26/05, Jeff Watkins <[EMAIL PROTECTED]> wrote: > > > On 26 Oct, 2005, at 3:54 pm, william wrote: > > > I've observed that even for pages where we don't have specified the > > "identity.require", TG make a query in the DB (I'm using Postgres in > > debug mode:?debug=1). > > Absolutely true. Every time you make a request, I need to bring your > User object into memory. Otherwise, you couldn't access your User's > information.
But if you don't even require a valid user, do you need to bring the User object into memory? > > Don't know if it's normal, but don't sounds logic to me. > > I understand that SQLObject allows you to cache objects, but I don't > know enough about it to suggest how you should enable it. SQLObject is likely caching the object, but it does not (AFAIK) cache SelectResults. For example, User.get(5) User.get(5) will only run the query once. iter(User.select(...some set of params)).next() iter(User.select(...some set of params)).next() The first time, it will run the main select, and another query to bring in the full object (there's a way around that second query there, but it's not my point so I'll gloss over it) The second time, it will run the main query but won't run another query to bring in the object, because it would be in the cache. So, if the cookie contained the ID of the user object (securely signed, of course), you could do a User.get() and save a query. Kevin

