Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWm4m-00042H-QG for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Jan 2017 15:35:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cWm4m-0005FE-6h for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Jan 2017 15:35:04 +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 1cWm4l-0005Ex-6K for pgsql-hackers@postgresql.org; Thu, 26 Jan 2017 15:35:03 +0000 Received: from mail-vk0-x229.google.com ([2607:f8b0:400c:c05::229]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cWm4h-0005f4-RS for pgsql-hackers@postgresql.org; Thu, 26 Jan 2017 15:35:02 +0000 Received: by mail-vk0-x229.google.com with SMTP id r136so156719073vke.1 for ; Thu, 26 Jan 2017 07:34:59 -0800 (PST) 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=KjvEPDSTNiC/zWmW+De9mNj3u+V6OyHUzOa9dCl+Lvk=; b=soGjYhfNMuz2bvRn7Vr1tib//ZE3BIGMODiyZ6Qrkd8J2jz1I2f1kYj3el+VRjj86n pVngWZHicRkFWx+YjgfHUuLTMeOjb9Jd+/jT3BzAQziU3Z/3UBfhDW3niHS1vssQOGE/ G15rm5kl1SmnUIMiJqCVR6PvMHfygJ8AlJayOFmSbLTctl994+FTAF+hnXQJMz4njQSC CMiUnnPWeP0ZOybvKHZ7mvqLz9w8zum5HD9d8DwHNp2MszS3FnqR7g4UtYrDC7bjP/xN raOePEFHf6tVR2Cg7O9oIjiJAkwnxgUB2tOt3LAwYA2XPqiav5022NCBd5Z3HrbdpGxp hmxw== 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=KjvEPDSTNiC/zWmW+De9mNj3u+V6OyHUzOa9dCl+Lvk=; b=pyoCq2bEf6w37BqEcN6ZoCYuKA/Av4TqNxnao9RBmAQvSuUJBY39LXWtifZrIPIJEX ClCnixkCfVTzvlApZRla+0lsxR8RNqaQesMT7ErNf2U8EPLdvaFuQsQqgH5W/E7OfBAM 0ax+n+dZfq6LBgQBhRcfryuXVVN+ncemjne4yxW4Cd375MKGyup2Q1nU3e3Y8n3wdulz 56+lqN+2zUHZx6rlcMANuChC4Wf+1aPRYXAIpXA8PK0vzK4pKAOYHynULuT0n81NtXgU ytMfXaNCUf75CPTvy3/zjzUY0Ds36/hj7aEVKAATMUdOU9vpthFN+Kv6H+MsLKaUOoJm +J4A== X-Gm-Message-State: AIkVDXKh4YABhj+aUB5vAuIJLoSrNtYHlp/iWdsk0QLH3gPSPdzMCpC9qwAyFAcD3lDufBmv X-Received: by 10.31.76.198 with SMTP id z189mr1672445vka.157.1485444897902; Thu, 26 Jan 2017 07:34:57 -0800 (PST) Received: from alvin.alvh.no-ip.org ([186.9.133.59]) by smtp.gmail.com with ESMTPSA id 111sm676228uar.18.2017.01.26.07.34.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jan 2017 07:34:57 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 1ACF5E13; Thu, 26 Jan 2017 00:26:48 -0300 (CLST) Date: Thu, 26 Jan 2017 00:26:48 -0300 From: Alvaro Herrera To: Pavan Deolasee Cc: Jaime Casanova , Haribabu Kommi , Tomas Vondra , pgsql-hackers Subject: Re: Patch: Write Amplification Reduction Method (WARM) Message-ID: <20170126032648.i2obutrun6k5bkle@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170125210832.p7johdmfnqvd2ysn@alvherre.pgsql> User-Agent: NeoMutt/20170113 (1.7.2) X-Pg-Spam-Score: -0.9 (/) 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 Alvaro Herrera wrote: > I wonder if heap_hot_search_buffer() and heap_hot_search() should return > a tri-valued enum instead of boolean; that idea looks reasonable in > theory but callers have to do more work afterwards, so maybe not. > > I think heap_hot_search() sometimes leaving the buffer pinned is > confusing. Really, the whole idea of having heap_hot_search have a > buffer output argument is an important API change that should be better > thought. Maybe it'd be better to return the buffer pinned always, and > the caller is always in charge of unpinning if not InvalidBuffer. Or > perhaps we need a completely new function, given how different it is to > the original? If you tried to document in the comment above > heap_hot_search how it works, you'd find that it's difficult to > describe, which'd be an indicator that it's not well considered. Even before your patch, heap_hot_search claims to have the same API as heap_hot_search_buffer "except that caller does not provide the buffer." But this is a lie and has been since 9.2 (more precisely, since commit 4da99ea4231e). I think WARM makes things even worse and we should fix that. Not yet sure which direction to fix it ... -- Á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