Le lundi 25 septembre 2006 à 12:59 +0400, Oleg Broytmann a écrit :
> On Mon, Sep 25, 2006 at 10:26:29AM +0200, Didrik Pinte wrote:
> >   class sqlmeta:
> >           # cacheValues is needed as soons as we need transactions and
> > concurrent access to the database
> >           cacheValues = False
> 
>    Set cacheValues to True and retry.
> 
> Oleg.

I've tried with "cacheValues = True", it changes something but it still
a problem. With the cacheValues, it spares all the specific queries for
each row of the table but it does a "select * from rawdata". This seems
to be translated in getting all the objects into memory. My test table
counts only 800.000 rows and memory usage is not efficient at all.

Here is the way it behaves with the cacheValues set to True :

>>> rawdata.sqlmeta.cacheValues
True
>>> for a in rawdata.select():
...     if a.id < 10:
...             print a
...
 1/Select  :  SELECT rawdata.id, rawdata.mtime, rawdata.station_id,
rawdata.tsa, rawdata.tha, rawdata.hra, rawdata.tsf, rawdata.tss,
rawdata.ens, rawdata.dvt, rawdata.vvt, rawdata.plu FROM rawdata WHERE 1
= 1
 1/QueryR  :  SELECT rawdata.id, rawdata.mtime, rawdata.station_id,
rawdata.tsa, rawdata.tha, rawdata.hra, rawdata.tsf, rawdata.tss,
rawdata.ens, rawdata.dvt, rawdata.vvt, rawdata.plu FROM rawdata WHERE 1
= 1
 1/COMMIT  :  auto
<rawdata 1 mtime='datetime.datetime...)' stationID=1
tsa=1.8999999999999999 tha=1.8999999999999999 hra=99.799999999999997
tsf=-0.20000000000000001 tss=1.3999999999999999 ens=0.0 dvt=None
vvt=-999.0 plu=0.0>
<rawdata 2 mtime='datetime.datetime...)' stationID=1 tsa=2.0 tha=2.0
hra=99.799999999999997 tsf=-0.20000000000000001 tss=1.3999999999999999
ens=0.0 dvt=None vvt=1.3 plu=0.10000000000000001>
<rawdata 3 mtime='datetime.datetime...)' stationID=1
tsa=2.1000000000000001 tha=2.1000000000000001 hra=99.799999999999997
tsf=-0.20000000000000001 tss=1.3999999999999999 ens=0.0 dvt=None
vvt=1.6000000000000001 plu=0.0>
<rawdata 4 mtime='datetime.datetime...)' stationID=1 tsa=1.7
tha=1.6000000000000001 hra=97.900000000000006 tsf=-0.20000000000000001
tss=1.3999999999999999 ens=0.0 dvt=None vvt=1.5 plu=0.29999999999999999>
<rawdata 5 mtime='datetime.datetime...)' stationID=1
tsa=1.3999999999999999 tha=1.3999999999999999 hra=99.799999999999997
tsf=-0.20000000000000001 tss=1.3999999999999999 ens=0.0 dvt=None vvt=1.5
plu=0.59999999999999998>
<rawdata 6 mtime='datetime.datetime...)' stationID=1
tsa=1.3999999999999999 tha=1.3999999999999999 hra=99.799999999999997
tsf=-0.20000000000000001 tss=1.3999999999999999 ens=0.0 dvt=None vvt=1.5
plu=0.20000000000000001>
<rawdata 7 mtime='datetime.datetime...)' stationID=1 tsa=1.5 tha=1.5
hra=99.799999999999997 tsf=-0.20000000000000001 tss=1.3999999999999999
ens=0.0 dvt=None vvt=1.8999999999999999 plu=0.0>
<rawdata 8 mtime='datetime.datetime...)' stationID=1 tsa=1.5 tha=1.5
hra=99.799999999999997 tsf=-0.20000000000000001 tss=1.3999999999999999
ens=0.0 dvt=None vvt=1.5 plu=0.20000000000000001>
<rawdata 9 mtime='datetime.datetime...)' stationID=1
tsa=1.3999999999999999 tha=1.3999999999999999 hra=99.799999999999997
tsf=-0.20000000000000001 tss=1.3999999999999999 ens=0.0 dvt=None vvt=1.8
plu=0.29999999999999999>
>>>


I'm running with sqlobject 0.7.1-1 (debian/sid version). The backend is
a Postgres 8.1 database.

Didrik


Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée

-------------------------------------------------------------------------
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
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to