<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
	>
<channel>
	<title>Comments on: Copying Amazon SimpleDB Domains</title>
	<atom:link href="http://avdi.org/devblog/2009/10/28/copying-amazon-simpledb-domains/feed/" rel="self" type="application/rss+xml" />
	<link>http://avdi.org/devblog/2009/10/28/copying-amazon-simpledb-domains/</link>
	<description>"...the three great virtues of a programmer: laziness, impatience, and hubris." -- Larry Wall</description>
	<lastBuildDate>Wed, 03 Mar 2010 21:56:22 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: avdi</title>
		<link>http://avdi.org/devblog/2009/10/28/copying-amazon-simpledb-domains/comment-page-1/#comment-783</link>
		<dc:creator>avdi</dc:creator>
		<pubDate>Mon, 30 Nov 2009 19:06:48 +0000</pubDate>
		<guid isPermaLink="false">http://avdi.org/devblog/?p=285#comment-783</guid>
		<description>You&#039;re quite right, in some more recent scripts I&#039;ve taken the next token into account.</description>
		<content:encoded><![CDATA[<p>You&#39;re quite right, in some more recent scripts I&#39;ve taken the next token into account.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen</title>
		<link>http://avdi.org/devblog/2009/10/28/copying-amazon-simpledb-domains/comment-page-1/#comment-782</link>
		<dc:creator>Stephen</dc:creator>
		<pubDate>Mon, 30 Nov 2009 17:08:38 +0000</pubDate>
		<guid isPermaLink="false">http://avdi.org/devblog/?p=285#comment-782</guid>
		<description>Cool! The calculation of the count on line 13 isn&#039;t 100% correct though, as it won&#039;t work right on very large domains. This is because &#039;select count(*)&#039; operations will return before they are complete if the operation is going to take longer than 5 seconds. I find this usually happens when the domain has &gt;75k items.&lt;br&gt;&lt;br&gt;Perhaps there&#039;s a more elegant way to solve this, but in my code, I do as follows to calculate the count of a domain:&lt;br&gt;&lt;br&gt;next_token = nil&lt;br&gt;count = 0&lt;br&gt;begin &lt;br&gt;  response = sdb.select(&quot;select count(*) from `#{domain_name}`&quot;, next_token)&lt;br&gt;  count += response[:items][0][&#039;Domain&#039;][&#039;Count&#039;][0].to_i&lt;br&gt;  next_token = response[:next_token]&lt;br&gt;end while next_token</description>
		<content:encoded><![CDATA[<p>Cool! The calculation of the count on line 13 isn&#39;t 100% correct though, as it won&#39;t work right on very large domains. This is because &#39;select count(*)&#39; operations will return before they are complete if the operation is going to take longer than 5 seconds. I find this usually happens when the domain has &gt;75k items.</p>
<p>Perhaps there&#39;s a more elegant way to solve this, but in my code, I do as follows to calculate the count of a domain:</p>
<p>next_token = nil<br />count = 0<br />begin <br />  response = sdb.select(&#8221;select count(*) from `#{domain_name}`&#8221;, next_token)<br />  count += response[:items]<sup class="footnote"><a href="#fn0">0</a></sup>[&#39;Domain&#39;][&#39;Count&#39;]<sup class="footnote"><a href="#fn0">0</a></sup>.to_i<br />  next_token = response[:next_token]<br />end while next_token</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 3.855 seconds -->
