Re: QuerySet without result_cache?

2009-08-28 Thread Sam Tregar
On Thu, Aug 27, 2009 at 8:18 PM, Alex Gaynor wrote: > > On Thu, Aug 27, 2009 at 5:56 PM, Sam Tregar wrote: > > On Thu, Aug 27, 2009 at 5:47 PM, Alex Gaynor > wrote: > >> > >> Instead of iterating over the QuerySet itself, use > >> QuerySet.iterator(), t

Re: QuerySet without result_cache?

2009-08-27 Thread Sam Tregar
On Thu, Aug 27, 2009 at 5:47 PM, Alex Gaynor wrote: > > Instead of iterating over the QuerySet itself, use > QuerySet.iterator(), this will avoid populating the result cache. > Thanks, works great! This would make a good addition to the manual section that describes how the QuerySet cache syste

QuerySet without result_cache?

2009-08-27 Thread Sam Tregar
Hey all. So, I figured out how to run my QuerySet through MySQLdb's SSCursor! Woo! Bad news: it's still using a ton of memory. As far as I can tell it's being used by QuerySet's internal _result_cache which is holding all the rows retrieved by the query. Is there any way to turn this cache off

How to control which DB connection and cursor a queryset will use

2009-08-27 Thread Sam Tregar
I'm trying to get a queryset to issue its query over a different DB connection, using a different cursor class. Does anyone know if that's possible and if so how it might be done? In psuedo-code: # setup a new db connection: db = db_connect(cursorclass=AlternateCursor) # setup a generic q

Executing a queryset with MySQL's SSCursor cursor class

2009-08-26 Thread Sam Tregar
Hello all. I'm wondering how I can tell Django to use MySQLdb.cursors.SSCursor instead of the default MySQLdb.cursors.Cursor. The critical difference here is that SSCursor uses mysql_use_result and streams data from the server rather than loading it all into memory at once. Anybody know if that's

Re: How to implement a custom field (or relation) which supports List of Strings

2009-07-17 Thread Sam Tregar
On Fri, Jul 17, 2009 at 3:23 PM, Dudley Fox wrote: > > Should I have posted this to the developer's list? I ask because I > have received no responses yet. Not even a "...you shouldn't do that." > :) I can help you with that - you shouldn't do that. Instead you should create a new model for f

Re: home page caching

2009-07-13 Thread Sam Tregar
On Mon, Jul 13, 2009 at 3:34 PM, Ramdas S wrote: > I have a web site where around 15 SQL semi complex queries run on the home > page. Traffic is increasing and the page loads are getting slower. What is > the best way to cache just the home page. I have already done standard > memcached on the se