Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnrvf-00062O-EL for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Mar 2017 19:16:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cnrvf-0006Xa-0r for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Mar 2017 19:16:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cnrvd-0006No-54 for pgsql-hackers@postgresql.org; Tue, 14 Mar 2017 19:16:17 +0000 Received: from mail-qk0-x22f.google.com ([2607:f8b0:400d:c09::22f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cnrvZ-000569-Nh for pgsql-hackers@postgresql.org; Tue, 14 Mar 2017 19:16:16 +0000 Received: by mail-qk0-x22f.google.com with SMTP id v125so251124585qkh.2 for ; Tue, 14 Mar 2017 12:16:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=9wYY+4XbLXBIwU/AOOIbfatvIXj+0ZfH+eJCkaOvOqo=; b=eZy+NE8eH+RBCg/5JAmfaaKNAeCNBBmdEG6yD4yQtGvNNjPzdUVXzxdgKhzA9sfPKd fsS5NrEhSast66dZBNgSVu8I3XpPMqn0tcaF26nEsP3oBfFLjtPh1wWRbQx0IidN+i12 WdsBYccnLYBP0wZJHwoSLWcX58bak24lFAzRLQEKlGLRnvIdelj5GIBxO0td/sVsnpBu HjGkddboyP+8m9sr7r2FdkRzb/UtVkLq+vPFFkGFFUgJO1lhWSzqOPhiAOokmejtolY+ fICSDtIq62ddg0JNYG0tKwkOF0WFOR5oCzxxvBUZYI9X4l4RakxxTGGPBi6YBDtpBNzg 6z0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=9wYY+4XbLXBIwU/AOOIbfatvIXj+0ZfH+eJCkaOvOqo=; b=QDcoG5Yah4byvkjkNsqgKx1ZZQG9+rVYpvqwZcfEDFBKFIypP1d7W9jZbB8dRsh3B3 kfRhA9LQOktob5U0NBCs/iIC5HYWmAe9ETdWwgYpkeQZ/h0tGtO3LLslr3CdwnDhW4tJ C4On46kCzkGgU5tXXI7gghqY5qkxTkYIRVyFdLHKlKrX5X3x4za9GQ8TtjuSWA9q8ikw +BfgEJqcCbBWEMyX13NizcWiD4YLxviWzWdtpRMwu+fxB1Vb7zaWi7oZtL3N9ITIc2PR LY8RodmTLOGYKTKWv4TKTDwBn1aohZrwP/6Oe8dmZaTq3Co9Jg+rCEp8KS9BTQg5XDCo MPxQ== X-Gm-Message-State: AFeK/H2t77R75648nU/WuYEq2Wzz9xODDaoQw/NBfBA7hf2dhg4o7envbWnaaT4xnKBEAS/R X-Received: by 10.55.192.145 with SMTP id v17mr41134076qkv.3.1489518972124; Tue, 14 Mar 2017 12:16:12 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([179.57.115.10]) by smtp.gmail.com with ESMTPSA id q15sm15048019qtc.1.2017.03.14.12.16.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Mar 2017 12:16:11 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id C1764DA0; Tue, 14 Mar 2017 16:16:09 -0300 (CLST) Date: Tue, 14 Mar 2017 16:16:09 -0300 From: Alvaro Herrera To: Pavan Deolasee Cc: Robert Haas , Bruce Momjian , Jaime Casanova , Haribabu Kommi , Tomas Vondra , pgsql-hackers Subject: Re: Patch: Write Amplification Reduction Method (WARM) Message-ID: <20170314191609.tzw6bz3uigbqmtif@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170206-195-7adf12 (1.7.2) 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 Pavan Deolasee wrote: > On Tue, Mar 14, 2017 at 7:17 AM, Alvaro Herrera > wrote: > > I have already commented about the executor involvement in btrecheck(); > > that doesn't seem good. I previously suggested to pass the EState down > > from caller, but that's not a great idea either since you still need to > > do the actual FormIndexDatum. I now think that a workable option would > > be to compute the values/isnulls arrays so that btrecheck gets them > > already computed. > > I agree with your complaint about modularity violation. What I am unclear > is how passing values/isnulls array will fix that. The way code is > structured currently, recheck routines are called by index_fetch_heap(). So > if we try to compute values/isnulls in that function, we'll still need > access EState, which AFAIU will lead to similar violation. Or am I > mis-reading your idea? You're right, it's still a problem. (Honestly, I think the whole idea of trying to compute a fake index tuple starting from a just-read heap tuple is a problem in itself; I just wonder if there's a way to do the recheck that doesn't involve such a thing.) > I wonder if we should instead invent something similar to IndexRecheck(), > but instead of running ExecQual(), this new routine will compare the index > values by the given HeapTuple against given IndexTuple. ISTM that for this > to work we'll need to modify all callers of index_getnext() and teach them > to invoke the AM specific recheck method if xs_tuple_recheck flag is set to > true by index_getnext(). Yeah, grumble, that idea does sound intrusive, but perhaps it's workable. What about bitmap indexscans? AFAICS we already have a recheck there natively, so we only need to mark the page as lossy, which we're already doing anyway. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers