Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQhSH-000355-1J for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Apr 2013 17:08:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UQhSG-000248-D6 for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Apr 2013 17:08:04 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQhSF-000243-Pi for pgsql-bugs@postgresql.org; Fri, 12 Apr 2013 17:08:03 +0000 Received: from moutng.kundenserver.de ([212.227.126.171]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQhS9-00069v-Ce for pgsql-bugs@postgresql.org; Fri, 12 Apr 2013 17:08:03 +0000 Received: from anarazel.de (p5DDC7B23.dip.t-dialin.net [93.220.123.35]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0M5tBF-1UkxAA2K6b-00xc1w; Fri, 12 Apr 2013 19:07:55 +0200 Received: by anarazel.de (Postfix, from userid 1000) id 95F221C00F8; Fri, 12 Apr 2013 19:07:54 +0200 (CEST) Date: Fri, 12 Apr 2013 19:07:54 +0200 From: Andres Freund To: Tarvi Pillessaar Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #8059: sequence crash recovery is not working properly Message-ID: <20130412170754.GA6209@awork2.anarazel.de> References: <20130412140416.GF5766@alap2.anarazel.de> <51683E0F.60001@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51683E0F.60001@gmail.com> X-Provags-ID: V02:K0:vomPlKGa6Qxpk4cVPMTNtiqjKw1eH5C4mpKVR2CTkBW m5X2Po8fV3+hJ5/fjloMurXsK4NHSLdHKVXlQRAd+J3DAfu7jb cX9m8zRBEjvVlP4TUSSz+gzmYDSVHZ8G066pt2AbSDFGT4jFrW 3Qf5rTvyNnJZ7sy9m0NKhvJYogNr8/aVINcJ/WgucZQ8DNg6bW Kk4aTR8mVbnwkzRq1eCh8mEFa6YyZtzsh88fqzJSt95a4lRsKt UGhplJqUUeriNaDpZ71n5RRgAtU1lKGkIA+3OiKqm2umdQ7wcs hxBqrIqztDZtyG/YQa6Cibe16lGkChedIx91G2bru0M7oG96Jr e3NbkFs6rTgTBUU+RXdLPQsjsdXNqa3Zwfvx/6oel X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 2013-04-12 20:02:07 +0300, Tarvi Pillessaar wrote: > On 12.04.2013 17:04, Andres Freund wrote: > >On the other hand, at > >least in the first example you haven't even committed the transaction so > >there's nothing that could flush the transaction unless we we would > >*always* flush nextval() immediately if needs to get new values which > >doesn't seem reasonable. > Yes, i know that i haven't commited anything and also i agree that flushing > always is not reasonable. > I'm not sure that i understand all the details in sequence.c, but there > seems to be some sort of cache used for sequences, so instead of flushing > always maybe flush should only happen if next batch of values are written to > cache. Flushing everytime the cache is used up will have a far too high overhead. Consider bulk loading new data into a table. If we would flush wal every 32 new rows that would be disastrous from a performance perspective. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs