Re: [SQLObject] FloatCol, distinct+count and others
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Robert L. <ro...@le...> - 2004-09-30 18:46:51
|
(Oops, replied directly to Ian - hey, it's 4:45am what else do you expect!) Ian Bicking wrote: > Marcin Wojdyr wrote: > >> Hi, >> I will write about a few things, that make me not 100% happy >> with SQLObject, in one mail. >> >> First about MultipleJoin: as Robert wrote in >> http://sourceforge.net/mailarchive/forum.php?thread_id=5435228&forum_id=30269 >> >> person.addresses will generate n+1 queries to DB. > > > I don't think that is what happens...? It's certainly not intended to > cause that many selects. Unfortunately, it does, at least it does when using Postgres, a fresh install of SQLObject 0.6, Python 2.3.3, W2000 :-( The first select is : SELECT id FROM address WHERE person_id = ### which returns 'n' id's then for every id in the returned list there is : SELECT column(s)... FROM address WHERE id = #### i.e. n+1 queries to DB. Robert |