<?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/"
		>
<channel>
	<title>Comments on: MySQL Stored Function: parsing a JSON encoded string</title>
	<atom:link href="http://blog.hungrymachine.com/2008/04/14/mysql-stored-function-parsing-a-json-encoded-string/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hungrymachine.com/2008/04/14/mysql-stored-function-parsing-a-json-encoded-string/</link>
	<description>The guys behind LivingSocial</description>
	<lastBuildDate>Mon, 08 Mar 2010 10:34:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Joe Grossberg</title>
		<link>http://blog.hungrymachine.com/2008/04/14/mysql-stored-function-parsing-a-json-encoded-string/comment-page-1/#comment-145</link>
		<dc:creator>Joe Grossberg</dc:creator>
		<pubDate>Mon, 14 Apr 2008 21:00:00 +0000</pubDate>
		<guid isPermaLink="false">blog.hungrymachine.com/2008/11/13/mysql-stored-function-parsing-a-json-encoded-string#comment-145</guid>
		<description>&lt;p&gt;Interesting proof-of-concept.&lt;/p&gt;

&lt;p&gt;I&#039;m curious about the motivations for this, since you said, &quot;Although we don&#039;t often need to query it directly, from time to time, it makes things a bit easier/faster&quot;. But then you say performance was &quot;pretty slow&quot;, so why did you do it in SQL instead of Ruby?&lt;/p&gt;

&lt;p&gt;Also, by limiting it to 255 chars, I&#039;m guessing that you know the JSON keys&#039; names. Why not just split that JSON string and insert into multiple columns? (You say that it has no nested hashes nor arrays.)&lt;/p&gt;

&lt;p&gt;And how do you avoid truncating that JSON when it&#039;s too long (thus corrupting it)?&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>&lt;p&gt;Interesting proof-of-concept.&lt;/p&gt;</p>
<p>&lt;p&gt;I&#8217;m curious about the motivations for this, since you said, &quot;Although we don&#8217;t often need to query it directly, from time to time, it makes things a bit easier/faster&quot;. But then you say performance was &quot;pretty slow&quot;, so why did you do it in SQL instead of Ruby?&lt;/p&gt;</p>
<p>&lt;p&gt;Also, by limiting it to 255 chars, I&#8217;m guessing that you know the JSON keys&#8217; names. Why not just split that JSON string and insert into multiple columns? (You say that it has no nested hashes nor arrays.)&lt;/p&gt;</p>
<p>&lt;p&gt;And how do you avoid truncating that JSON when it&#8217;s too long (thus corrupting it)?&lt;/p&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Warren</title>
		<link>http://blog.hungrymachine.com/2008/04/14/mysql-stored-function-parsing-a-json-encoded-string/comment-page-1/#comment-146</link>
		<dc:creator>Warren</dc:creator>
		<pubDate>Mon, 14 Apr 2008 21:00:00 +0000</pubDate>
		<guid isPermaLink="false">blog.hungrymachine.com/2008/11/13/mysql-stored-function-parsing-a-json-encoded-string#comment-146</guid>
		<description>Long story short, we&#039;re storing large amounts of data for analytics purposes.  We pull out useful info that we know we&#039;ll be using frequently into distinct columns so we can query it faster, but we throw the rest of the data (which has no particular structure) into a TEXT field as JSON.  In terms of Ruby vs. MySQL, MySQL can process the JSON we need in seconds and discard the rows we don&#039;t need where as just the transfer time of getting all that data into Ruby and then processing it is minutes to hours.</description>
		<content:encoded><![CDATA[<p>Long story short, we&#8217;re storing large amounts of data for analytics purposes.  We pull out useful info that we know we&#8217;ll be using frequently into distinct columns so we can query it faster, but we throw the rest of the data (which has no particular structure) into a TEXT field as JSON.  In terms of Ruby vs. MySQL, MySQL can process the JSON we need in seconds and discard the rows we don&#8217;t need where as just the transfer time of getting all that data into Ruby and then processing it is minutes to hours.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad Baumann</title>
		<link>http://blog.hungrymachine.com/2008/04/14/mysql-stored-function-parsing-a-json-encoded-string/comment-page-1/#comment-147</link>
		<dc:creator>Brad Baumann</dc:creator>
		<pubDate>Mon, 14 Apr 2008 21:00:00 +0000</pubDate>
		<guid isPermaLink="false">blog.hungrymachine.com/2008/11/13/mysql-stored-function-parsing-a-json-encoded-string#comment-147</guid>
		<description>I think this will be very useful once it&#039;s tweaked a bit.
I&#039;m having some problems with the function detecting value types other than strings.

For example:
SELECT JSON(
&#039;{&quot;fieldname&quot;:12345,&quot;fieldname2&quot;:&quot;test string&quot;}&#039;, &#039;fieldname&#039;
)

Returns: &quot;fieldname2&quot;

If you do this for &quot;fieldname2&quot;, you&#039;ll get the right return value of &quot;test string&quot;.

I&#039;ll try to code a quick work around... unless theres something I&#039;m missing?</description>
		<content:encoded><![CDATA[<p>I think this will be very useful once it&#8217;s tweaked a bit.<br />
I&#8217;m having some problems with the function detecting value types other than strings.</p>
<p>For example:<br />
SELECT JSON(<br />
&#8216;{&quot;fieldname&quot;:12345,&quot;fieldname2&quot;:&quot;test string&quot;}&#8217;, &#8216;fieldname&#8217;<br />
)</p>
<p>Returns: &quot;fieldname2&quot;</p>
<p>If you do this for &quot;fieldname2&quot;, you&#8217;ll get the right return value of &quot;test string&quot;.</p>
<p>I&#8217;ll try to code a quick work around&#8230; unless theres something I&#8217;m missing?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
