<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>David Cramer's Blog - Latest Comments in Large SQL Result Sets in Django</title><link>http://davidcramer.disqus.com/</link><description></description><atom:link href="https://davidcramer.disqus.com/thread_94/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 29 Mar 2010 03:40:51 -0000</lastBuildDate><item><title>Re: Large SQL Result Sets in Django</title><link>http://cramer.io//412/large-sql-result-sets-in-django.html#comment-42078019</link><description>&lt;p&gt;Very useful recipe. There is a a "semi-bug" in IterableQuerySet that kicks in if you try to use it on an unordered resultset which i learnt the hard way. The order of select results where the order is not explicitly set using an order by clause is undefined.&lt;/p&gt;&lt;p&gt;To fix that, I changed the constructor to "self.queryset = queryset.order_by('id')" so that you are ensured that there are always some order in the results.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn</dc:creator><pubDate>Mon, 29 Mar 2010 03:40:51 -0000</pubDate></item><item><title>Re: Large SQL Result Sets in Django</title><link>http://cramer.io//412/large-sql-result-sets-in-django.html#comment-38940779</link><description>&lt;p&gt;It's nothing complicated, just a normal iterable wrapper.&lt;/p&gt;&lt;p&gt;for result in IterableQuerySet(qs): print result&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">David Cramer</dc:creator><pubDate>Tue, 17 Feb 2009 11:40:59 -0000</pubDate></item><item><title>Re: Large SQL Result Sets in Django</title><link>http://cramer.io//412/large-sql-result-sets-in-django.html#comment-38940777</link><description>&lt;p&gt;Hi,&lt;br&gt;I am facing similar problem for which i had blogged as well. &lt;br&gt;I think that you code may help me, but I am unable to use it.&lt;br&gt;It wud be helpful if you could give some sample usage also.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nitin</dc:creator><pubDate>Tue, 17 Feb 2009 11:22:53 -0000</pubDate></item><item><title>Re: Large SQL Result Sets in Django</title><link>http://cramer.io//412/large-sql-result-sets-in-django.html#comment-38940776</link><description>&lt;p&gt;Little typo in IterableQuerySet:&lt;/p&gt;&lt;p&gt;self.batch = batch&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pterk</dc:creator><pubDate>Tue, 10 Feb 2009 04:38:53 -0000</pubDate></item><item><title>Re: Large SQL Result Sets in Django</title><link>http://cramer.io//412/large-sql-result-sets-in-django.html#comment-38940775</link><description>&lt;p&gt;Why not use the queryset's iterator method, e.g. model.objects.all().iterator()? It works fine for me with a table containing 1.2 million rows of which I write ~600 thousand to a csv file.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">megaman821</dc:creator><pubDate>Mon, 09 Feb 2009 20:22:17 -0000</pubDate></item><item><title>Re: Large SQL Result Sets in Django</title><link>http://cramer.io//412/large-sql-result-sets-in-django.html#comment-38940772</link><description>&lt;p&gt;Very usefull, Thanks&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dilandau</dc:creator><pubDate>Mon, 09 Feb 2009 19:49:47 -0000</pubDate></item></channel></rss>