Oleg Broytmann wrote:
> On Wed, Aug 31, 2005 at 03:53:42PM +0200, Koen Bok wrote:
>>If the object has 22 fields, where I only need two to display, and
>>client is connected to the server with a relatively slow connection
>>(dsl) there will be a lot of overhead. Don't you think?
> > Then you want to use SQLObject in a slightly strange non-OO way. But it
> is possible, too:
> from sqlobject.sqlbuilder import Select
> conn = MyTable.sqlmeta.connection
> a, b = conn.queryOne(conn.sqlrepr(
> Select(MyTable.q.a, MyTable.q.b, MyTable.q.c == "filterByMe")
You could also create an alternate class, like:
a = StringCol(immutable=True)
b = StringCol(immutable=True)
I.e., leave all the columns out that you aren't interested in. The
effects on caching are... well, a little bit of an issue, but it might
not be a problem, depending on your program.
However, remember that when you fetch all columns, you have them all
sitting around in memory, so if the program needs the rest of the
information later it won't have to be fetched. This might easily
outweigh the bandwidth savings of fetching columns more lazily.
Ian Bicking / ianb@... / http://blog.ianbicking.org