<?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: Stored Function to generate Sequences</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/</link>
	<description>Everything about MySQL Performance</description>
	<lastBuildDate>Wed, 10 Mar 2010 01:20:14 +0000</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Bruno Braga</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/comment-page-1/#comment-668321</link>
		<dc:creator>Bruno Braga</dc:creator>
		<pubDate>Sat, 24 Oct 2009 00:15:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/#comment-668321</guid>
		<description>Yeah, I did a stress testing on this, and worked fine (on InnoDB as well).</description>
		<content:encoded><![CDATA[<p>Yeah, I did a stress testing on this, and worked fine (on InnoDB as well).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baron Schwartz</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/comment-page-1/#comment-668117</link>
		<dc:creator>Baron Schwartz</dc:creator>
		<pubDate>Fri, 23 Oct 2009 12:23:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/#comment-668117</guid>
		<description>MyISAM has table-level locking.  It works.</description>
		<content:encoded><![CDATA[<p>MyISAM has table-level locking.  It works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruno Braga</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/comment-page-1/#comment-667566</link>
		<dc:creator>Bruno Braga</dc:creator>
		<pubDate>Thu, 22 Oct 2009 07:06:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/#comment-667566</guid>
		<description>This code does not handle concurrency/locking. Has anyone tested this against overloaded systems? I have the feeling it will not work properly.</description>
		<content:encoded><![CDATA[<p>This code does not handle concurrency/locking. Has anyone tested this against overloaded systems? I have the feeling it will not work properly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: saroj</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/comment-page-1/#comment-572044</link>
		<dc:creator>saroj</dc:creator>
		<pubDate>Tue, 02 Jun 2009 05:15:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/#comment-572044</guid>
		<description>thanks peter code worked</description>
		<content:encoded><![CDATA[<p>thanks peter code worked</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Using Multiple Sequences in a Table &#171; Everything MySQL</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/comment-page-1/#comment-355572</link>
		<dc:creator>Using Multiple Sequences in a Table &#171; Everything MySQL</dc:creator>
		<pubDate>Tue, 16 Sep 2008 18:32:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/#comment-355572</guid>
		<description>[...] issues.  After lot of trials, debates and finally referring Planet MySQL, I went ahead with this suggestion by Peter from MySQL Performance Blog and some help from here. CREATE TABLE sequences ( event_id [...]</description>
		<content:encoded><![CDATA[<p>[...] issues.  After lot of trials, debates and finally referring Planet MySQL, I went ahead with this suggestion by Peter from MySQL Performance Blog and some help from here. CREATE TABLE sequences ( event_id [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Huff</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/comment-page-1/#comment-337671</link>
		<dc:creator>Justin Huff</dc:creator>
		<pubDate>Thu, 31 Jul 2008 01:22:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/#comment-337671</guid>
		<description>I typically see the update step written like:
UPDATE sequence SET nValue=last_insert_id(nValue+1) WHERE strName=?

I&#039;d like to allow servers the option of asking for more than one id per call by moving the increment step outside the last_insert_id:
UPDATE sequence SET nValue=last_insert_id(nValue)+? WHERE strName=?

The value in the table shifts from being the &#039;last id handed out&#039; to &#039;the next id to hand out&#039;.  That way requesters don&#039;t need to know how big the last block was.

Am I missing something here? 
Thanks!</description>
		<content:encoded><![CDATA[<p>I typically see the update step written like:<br />
UPDATE sequence SET nValue=last_insert_id(nValue+1) WHERE strName=?</p>
<p>I&#8217;d like to allow servers the option of asking for more than one id per call by moving the increment step outside the last_insert_id:<br />
UPDATE sequence SET nValue=last_insert_id(nValue)+? WHERE strName=?</p>
<p>The value in the table shifts from being the &#8216;last id handed out&#8217; to &#8216;the next id to hand out&#8217;.  That way requesters don&#8217;t need to know how big the last block was.</p>
<p>Am I missing something here?<br />
Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Links for Wed 7 May 2008 - Joseph Scott&#8217;s Blog</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/comment-page-1/#comment-296732</link>
		<dc:creator>Links for Wed 7 May 2008 - Joseph Scott&#8217;s Blog</dc:creator>
		<pubDate>Thu, 08 May 2008 16:52:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/#comment-296732</guid>
		<description>[...] Stored Function to generate Sequences &#124; MySQL Performance Blog - You could combine this with an INSERT trigger and get even more auto_increment like functionality.  Tags: database mysql sequence [...]</description>
		<content:encoded><![CDATA[<p>[...] Stored Function to generate Sequences | MySQL Performance Blog &#8211; You could combine this with an INSERT trigger and get even more auto_increment like functionality.  Tags: database mysql sequence [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/comment-page-1/#comment-265378</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Fri, 04 Apr 2008 01:41:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/#comment-265378</guid>
		<description>Arjen,

Indeed insert on dup key updates saves you from initialization though I&#039;m wondering what way would be the faster.
Though I guess there would not be any significant difference here.</description>
		<content:encoded><![CDATA[<p>Arjen,</p>
<p>Indeed insert on dup key updates saves you from initialization though I&#8217;m wondering what way would be the faster.<br />
Though I guess there would not be any significant difference here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arjen Lentz</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/comment-page-1/#comment-265373</link>
		<dc:creator>Arjen Lentz</dc:creator>
		<pubDate>Fri, 04 Apr 2008 01:36:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/#comment-265373</guid>
		<description>kL, even with a sequence generator stored in MyISAM you would not see the same number in different threads.</description>
		<content:encoded><![CDATA[<p>kL, even with a sequence generator stored in MyISAM you would not see the same number in different threads.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arjen Lentz</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/comment-page-1/#comment-265372</link>
		<dc:creator>Arjen Lentz</dc:creator>
		<pubDate>Fri, 04 Apr 2008 01:34:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/#comment-265372</guid>
		<description>Here was mine http://arjen-lentz.livejournal.com/34627.html (been there for a few years ;-)
Also incorporates a trigger so the app can be oblivious it&#039;s not an AUTO_INCREMENT column.</description>
		<content:encoded><![CDATA[<p>Here was mine <a href="http://arjen-lentz.livejournal.com/34627.html" rel="nofollow">http://arjen-lentz.livejournal.com/34627.html</a> (been there for a few years <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
Also incorporates a trigger so the app can be oblivious it&#8217;s not an AUTO_INCREMENT column.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
