On Tue, Aug 01, 2006 at 11:26:48AM +0200, Didrik Pinte wrote:
> Ok, so it means that the following code will always require two queries
> in the same table in order to get the foreign key value ?
>
> # select the row
> vdata = validata.select(AND(validdata.q.stationID == station.id,
> validdata.q.mtime == row.mtime))[0]
> # get the tha state id
> vdata.tha_state_id
I think so.
> That's why it's so slow. I've 4.10^6 rows with 8 states per row. That
> means 7* 4.10^6 unwanted queries.
You certainly don't want to process them row by row. It would be too
slow in any case.
> Otherwise, I will use sqlbuilder and fetch the 8 states in one time.
This is probably the best approach.
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss