<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Tue, 21 May 2013 13:00:50 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Rob Young's Blog: Chunking Large Queries with Iterators in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/13350</guid>
      <link>http://www.phpdeveloper.org/news/13350</link>
      <description><![CDATA[<p>
Since sometimes you just don't want all of the results of a query back at once, <i>Rob Young</i> has <a href="http://www.roryoung.co.uk/2009/10/06/chunking-large-queries-with-iterators-in-php/">posted a solution</a> of his own using the Iterators included with PHP as a part of the <a href="http://php.net/spl">SPL</a>. His solution is to wrap it in <a href="http://www.roryoung.co.uk/wp-content/uploads/2009/10/ChunkedQueryIterator.phps">a ChunkedQueryIterator</a> that handles the work behind the scenes.
</p>
<blockquote>
When executing large queries it's usually best not to load the whole result set in one go. Memory isn't infinite and PHP isn't renowned for handling it very well. So the obvious answer is to chunk the large query in to lots of smaller queries. [...] We want something to which we can just provide a PDO object, an SQL query and the chunk size. We should then be able to iterate over the resulting object as though it were a single result set.
</blockquote>
<p>
He includes two code snippets of it in action, but asks the question of his readers - "How do you handle large database queries?" - to get some feedback on other alternatives. 
</p>]]></description>
      <pubDate>Wed, 07 Oct 2009 10:42:02 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Michael Caplan's Blog: Don't Forget to Flush ]]></title>
      <guid>http://www.phpdeveloper.org/news/11702</guid>
      <link>http://www.phpdeveloper.org/news/11702</link>
      <description><![CDATA[<p>
In <a href="http://www.eggplant.ws/blog/php/dont-forget-to-flush/">this recent post</a> to his blog <i>Michael Caplan</i> looks at a feature of PHP that's sometimes forgotten when pushing out larger chunks of data - flushing.
</p>
<blockquote>
As a recluse who prefers hiding behind servers rather than dancing around your web browser's canvas, I was intrigued with their server side recommendations - however sparse they may be. In particular, <a href="http://developer.yahoo.com/performance/rules.html#flush">flushing</a> generated head content early to speed up overall page delivery and rending time was a technique new to me.
</blockquote>
<p>
<i>Michael</i> looks at what "flushing generated head content" means and includes a scenario - pulling the top palettes from the <a href="http://www.colourlovers.com/">COLOURlovers</a> site - and some performance stats on page load time and response time directly from the server (complete with graphs). 
</p>]]></description>
      <pubDate>Thu, 08 Jan 2009 12:09:15 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[ThinkPHP Blog: Handling large files with(out) PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/5929</guid>
      <link>http://www.phpdeveloper.org/news/5929</link>
      <description><![CDATA[<p>
On the ThinkPHP blog today, there's a <a href="http://blog.thinkphp.de/archives/131-Handling-large-files-without-PHP.html">quick hint</a> about dealing with larger files both with and whithout PHP.
</p>
<blockquote>
As <a href="http://www.microsoft.com/billgates/default.asp">one man</a> <a href="http://groups.google.com/group/alt.folklore.computers/msg/99ce4b0555bf35f4">was quoted</a> "640K of memory should be enough for anybody" no one will need to access more than 2 GB data. What happens if you - just for scientific reasons of course - try to access larger files using your 32bit hardware and your favorite programming language PHP?
</blockquote>
<p>
They <a href="http://blog.thinkphp.de/archives/131-Handling-large-files-without-PHP.html">give the example</a> of opening a large 2 gig file with PHP and the resulting error that would pop up. They try a few differnt ways before getting down to more of a non-PHP PHP solution (yes, you read that right). They decided, instead, to create a script to work with the file chunked, using an exec() call to the unix split command to break it up.
</p>]]></description>
      <pubDate>Wed, 02 Aug 2006 05:47:06 -0500</pubDate>
    </item>
  </channel>
</rss>
