Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1cRx-0003DY-9U for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Mar 2019 19:43:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1cRv-0007Kv-Mv for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Mar 2019 19:43:31 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1cRv-0007Kk-Em for pgsql-hackers@lists.postgresql.org; Wed, 06 Mar 2019 19:43:31 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1cRs-000478-SG for pgsql-hackers@lists.postgresql.org; Wed, 06 Mar 2019 19:43:30 +0000 Received: by mail-wr1-x442.google.com with SMTP id g12so14782215wrm.5 for ; Wed, 06 Mar 2019 11:43:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=3mMr/cZtkaij7r9pIEwG5x7JYNi6t55qVFLGYCQtTAg=; b=qIEr2X0mrA7bnr/PLcWrLLVO2zC4XlookEopKW5eTuaxVG8E4dZtPQbo5E1UuTAyTm Xg6KBIdFnQFIzrgAvWyb2lGs7vS+tfLQkdBU8yGKlBgNNZKPFRybxGd1l1EGEuRhG2UB yVNM3R9WXcee/9JDumpFPiWstDeiRl46H/KTcQAGFSyne8jSMaJKhgkC8nOBIPOioNjN vvLZxTW+Ccu2nFIUBqKRpUBNm++TWa8SViru51GU6p6pc4ZKMvLV862rirhjcT6Qb5Md nxOXVZAOuyz3f+ZNYKM8Im+x55gX2TeHaw9CV4giVFUq7XlbrHtYRQr+rjulK+Y+XjpM 6UUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3mMr/cZtkaij7r9pIEwG5x7JYNi6t55qVFLGYCQtTAg=; b=QjR9skFBMP1ZZoh1vmOGX/S8zW3NA1vIO5LttWe+/UH2/kgvQhvTADmYSlfd5upMce Hep6wKMH9DoLQ4w5IEALz4l+dd8kQh3CvKW7RDx/ULeuBOeavrfboXaCV/5+50bOj0+p KjUGkeYqb5qj7pYHtc5aQn0ZS5HM9bBKzbbn2p6XPSXngDHscxjUB0GkpPh07hNWJtGb GH1HVNt/5J+k1rp0EVuOkG4RD2lGCcR47Ty7e1iY3Bjri+ulXjVo1BNl6iqYTveOwTW4 apFO1nx5YfMWZkJJ+Q104DrcUlgCkw8xag3C5YjAn+Subcx7VI5Cz3Njs3/k++Q4NLpa aY/Q== X-Gm-Message-State: APjAAAW7V1dBS5AULnUjEEqomhdZnqmcb6jB2VHNYF5b4Kkys/xHf05Y 9EDliV4D7fxBM/Qivgwl3gqTPQfJ7RzcztLv4fAzHQGZWxWF2KtqZJJoxVVFY9eouQNqJ7c0TZh VimlJtump1l0MYZbsh+H3flsasasyPfp4aA36yShyOcXdT0BgNKdCfpDe7f5Jdfc9DkSp02Nd4U OBvEM9RtZqrklpg9z1Su3ojA== X-Google-Smtp-Source: APXvYqw3dqiPzJyPW5SC4yBt4vn/QhSUdf9uwDNTlkif3nAo2a/6gTIg7wQbHlcHBPlNwTh6wTjRXA== X-Received: by 2002:a5d:540f:: with SMTP id g15mr4432358wrv.126.1551901407206; Wed, 06 Mar 2019 11:43:27 -0800 (PST) Received: from [10.137.0.17] (ip-86-49-253-144.net.upcbroadband.cz. [86.49.253.144]) by smtp.gmail.com with ESMTPSA id m16sm4733936wro.78.2019.03.06.11.43.26 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 06 Mar 2019 11:43:26 -0800 (PST) Subject: Re: performance issue in remove_from_unowned_list() To: Robert Haas , Alvaro Herrera Cc: "Ideriha, Takeshi" , Postgres hackers References: <91454a24-f8dc-f806-f499-79580a4f5bb8@2ndquadrant.com> <20190306185250.GA18515@alvherre.pgsql> From: Tomas Vondra Message-ID: <7a449e8e-4e8b-46ce-4592-b7db9912b89f@2ndquadrant.com> Date: Wed, 6 Mar 2019 20:43:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/6/19 8:04 PM, Robert Haas wrote: > On Wed, Mar 6, 2019 at 1:53 PM Alvaro Herrera wrote: >> On 2019-Feb-08, Tomas Vondra wrote: >>> I'm wondering if we should just get rid of all such optimizations, and >>> make the unowned list doubly-linked (WIP patch attached, needs fixing >>> the comments etc.). >> >> +1 for that approach. > > +1 for me, too. > >> Did you consider using a dlist? > > Maybe that is worthwhile, but this is a smaller change, which I think > should count for quite a bit. Nothing keeps somebody from doing the > dlist change as a separate patch, if desired. > Yeah, although now that I think about it I wouldn't expect the dlist version to be much more complicated. We access next_unowned_reln on two or three places, IIRC, so switching to dlist would be trivial I think. What worries me more is that I observe the opposite behavior than what's described in comment for b4166911 (which is from 2018, so not that old) and 279628a0a7 (from 2013). So what changed since then? Seems fishy ... regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services