Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XMCei-0005xQ-JD for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Aug 2014 09:03:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XMCei-0006cv-2F for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Aug 2014 09:03:08 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XMCef-0006Zq-SP for pgsql-hackers@postgresql.org; Tue, 26 Aug 2014 09:03:06 +0000 Received: from mail-pd0-f171.google.com ([209.85.192.171]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XMCec-0002L6-Lg for pgsql-hackers@postgresql.org; Tue, 26 Aug 2014 09:03:04 +0000 Received: by mail-pd0-f171.google.com with SMTP id z10so22079476pdj.16 for ; Tue, 26 Aug 2014 02:03:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:mime-version:content-transfer-encoding; bh=b0E4zpQZusY2oC4U9Si5SaLYQSBwczAieD44Bg+mSpc=; b=QBQIBteoPxXJA9Z4kuDsUNaaQcrWUiDfMiRFyREoUqg1Ik5LCMlaMufebn9Fc1TEy3 xO/m8NlcUCDwH8NC5nmBRSYWr31Y7orkZflk5mQYRhCXk/y3xuel7g0Dv5Qy7+wd6IZL Zqszkih8Ktymuj9WgdZtEZaGyVSEfvh2hdXzc8oVmJjihplUBR/GPhESFz4pDnFk6Fgw 3CBfkfJsBIXrMK594e2dSrrvFOn628VM8ys+Mawmcx7NN1rQUCg7sJQjUNnoBXXMyliv AWNETiqWMJRJtR0Pmt8CmtX3F8z9lO5WTEzW1KR3ayjAeI44J0HL35gtigHlhJrc8Nr1 EZOQ== X-Gm-Message-State: ALoCoQkKqKfl0P9AaZ3WqAp9YhIHRO7NnGZbhPCkojLlOC53XnH4RgQrY6UR1+8rCQ+CzWs1cgAA X-Received: by 10.66.141.165 with SMTP id rp5mr18581184pab.115.1409043780925; Tue, 26 Aug 2014 02:03:00 -0700 (PDT) Received: from [192.168.0.105] (c-69-181-249-16.hsd1.ca.comcast.net. [69.181.249.16]) by mx.google.com with ESMTPSA id e11sm3607968pdm.47.2014.08.26.02.02.59 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Tue, 26 Aug 2014 02:03:00 -0700 (PDT) Message-ID: <1409043789.2335.330.camel@jeff-desktop> Subject: Re: Proposal for CSN based snapshots From: Jeff Davis To: Heikki Linnakangas Cc: Greg Stark , Robert Haas , Andres Freund , Alvaro Herrera , Bruce Momjian , Rajeev rastogi , Ants Aasma , PostgreSQL-development , Markus Wanner Date: Tue, 26 Aug 2014 02:03:09 -0700 In-Reply-To: <539AD153.9000004@vmware.com> References: <51B6C97B.1070000@bluegap.ch> <5370D323.1070606@vmware.com> <20140512144112.GB9619@awork2.anarazel.de> <5370E267.2020904@vmware.com> <20140515183436.GD25053@momjian.us> <20140515200632.GB16014@awork2.anarazel.de> <20140515213714.GB7857@eldon.alvh.no-ip.org> <53889CCB.7030005@vmware.com> <20140530152721.GC30516@awork2.anarazel.de> <5388D02D.6040305@vmware.com> <539AD153.9000004@vmware.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Fri, 2014-06-13 at 13:24 +0300, Heikki Linnakangas wrote: > Attached is a new patch. It now keeps the current pg_clog unchanged, but > adds a new pg_csnlog besides it. pg_csnlog is more similar to > pg_subtrans than pg_clog: it's not WAL-logged, is reset at startup, and > segments older than GlobalXmin can be truncated. It appears that this patch weakens the idea of hint bits. Even if HEAP_XMIN_COMMITTED is set, it still needs to find out if it's in the snapshot. That's fast if the xid is less than snap->xmin, but otherwise it needs to do a fetch from the csnlog, which is exactly what the hint bits are designed to avoid. And we can't get around this, because the whole point of this patch is to remove the xip array from the snapshot. If the transaction was committed a long time ago, then we could set PD_ALL_VISIBLE and the VM bit, and a scan wouldn't even look at the hint bit. If it was committed recently, then it's probably greater than the recentXmin. I think there's still room for a hint bit to technically be useful, but it seems quite narrow unless I'm missing something (and a narrowly-useful hint bit doesn't seem to be useful at all). I'm not complaining, and I hope this is not a showstopper for this patch, but I think it's worth discussing. Regards, Jeff Davis -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers