On Sat, Feb 06, 2010 at 04:54:07PM +0100, Petr Jake?? wrote:
> MyTable.select() method results to the
> SELECT my_table.* FROM my_table (or ALL column names are named explicitly)
>
> Is there a way to retrieve just some rows, not all of them.
Some columns, you mean? No, SQLObject instance can only select all of
the column or none of them. Perhaps "none of them" is what you whant. Set
class sqlmeta:
cacheValues = False
Now every attribute access executes a separate SELECT query just to
select this column from the table. If you read only a few attributes there
will be only a few SELECTs.
But I doubt it is faster or takes less memory than one wide SELECT. I'd
very much like to recommend to experiment and find out what way is really
faster.
Oleg.
--
Oleg Broytman http://phd.pp.ru/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|