Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcLpe-0004is-0G for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Aug 2016 00:14:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bcLpd-0002ZG-Eh for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Aug 2016 00:14:13 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bcLoE-0000wL-M5 for pgsql-hackers@postgresql.org; Wed, 24 Aug 2016 00:12:46 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bcLoB-0001TB-FP for pgsql-hackers@postgresql.org; Wed, 24 Aug 2016 00:12:45 +0000 Received: by mail-wm0-x22a.google.com with SMTP id i5so4327676wmg.0 for ; Tue, 23 Aug 2016 17:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=KjNGZ/sxDkUuU40XzKoLMiJBjaEFB1PZVQaIb9m2GRo=; b=L/qyAV81b98LNV/ICzVGdIGKZlw3yw/l3G6cZ49MFilZXAmRP/R/ScJACIZsOP6elD fLJSbszYEj3r+7XlPmH9K9j415A+tzlEzZwPO8j8u4wkf3g7TE8B7z/7P/UdO9a9ontU tllu4XfbPdf8B/DgJOBPDe7TEsTxBuHLf/+14BEae5LSwi7cjIL3CxMT4t6xznVqT96g Vc0waNcFK1fZQFkXQ7BkAVdkuIIC53dPu/LDvy2ZqMCFxSqKhbbpS6HH0TERchy1ZxqL aXRsCMeN2hfko6m3q3vRAKdk8gWTXYYfetwX1sc+wf6baNLpzVZm1wLjVwb5Rydtzw4K 7tMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=KjNGZ/sxDkUuU40XzKoLMiJBjaEFB1PZVQaIb9m2GRo=; b=LOLJJj/HWiA6t9uP2aqlZumVI/8ka/LOCTfxIiqmnoCtHMuR3w3z6WSghlVYgAkkzR GkIrLyUlCbkQJRlBokbvZOlZcN/hF3gmC6dIT/yWxt/HcB6a6BP7Ih72GhxIXYKC3//U Q8amKdsKLbrFUC6qSBwv03QSRIjwBmXVXjii/ow84OEpwGIbzPkYc/If8ORcB+/eABSm btHr4luQK92WjOT+b65X6dcoag7gJKBnYHXtVPMsqGGylarI3RdUJqHuhpx+FmR4WwUF GfY/K6iU/v9h8nRSlBZhEbRG+t+QfB8rd5rnIOkwXr3Fym79BMJAjRGmz+r11Fnvskhq p7/g== X-Gm-Message-State: AE9vXwNV0/0O24lrPoVatMcZSC+39LZd2kREhjm6JwuD3MADCM4HfjgizjNb7WzgwZ3Baj+EphjUGIu+MnxJFXfCZG56O9ZbXGRe02S4/OHo9zUeoNgQQ1QqZyF4rUorxtrY4YvfhOIiVO8cS6RoAR/Zfkn7wo5qtvc1lAp1LPeN4o6sPobzQISYeoAaOZg0mA3+eAI0p+eF X-Received: by 10.28.71.197 with SMTP id m66mr485250wmi.26.1471997561275; Tue, 23 Aug 2016 17:12:41 -0700 (PDT) Received: from [10.137.2.20] (178-253-200-198.adsl-a-10.sezampro.rs. [178.253.200.198]) by smtp.gmail.com with ESMTPSA id z17sm7181415wmz.23.2016.08.23.17.12.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Aug 2016 17:12:40 -0700 (PDT) Subject: Re: [Patch] Temporary tables that do not bloat pg_catalog (a.k.a fast temp tables) To: Claudio Freire References: <20160801124531.66cde374@fujitsu> <13191.1470072250@sss.pgh.pa.us> <20160804151451.6fb87507@fujitsu> <14212.1470595566@sss.pgh.pa.us> <20160815005755.gswdyjfob7dzw4yp@alap3.anarazel.de> <20319.1471223097@sss.pgh.pa.us> <20160815010852.5ijua2wm2edzimd4@alap3.anarazel.de> <20160815121216.46bd758d@e733> <95bdc353-1a89-3fe3-1181-eba558c4df83@BlueTreble.com> <40e4f58f-6cd9-01b0-2cc1-67dcb71a5d61@2ndquadrant.com> Cc: Robert Haas , Jim Nasby , Aleksander Alekseev , PostgreSQL Hackers From: Tomas Vondra Message-ID: <58b5c129-5df4-0bf6-9468-ae119b6428d0@2ndquadrant.com> Date: Wed, 24 Aug 2016 02:12:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Thunderbird/46.0a2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed 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 08/24/2016 12:38 AM, Claudio Freire wrote: > On Tue, Aug 23, 2016 at 7:25 PM, Tomas Vondra > wrote: >>>> Could someone please explain how the unlogged tables are supposed to fix >>>> the >>>> catalog bloat problem, as stated in the initial patch submission? We'd >>>> still >>>> need to insert/delete the catalog rows when creating/dropping the >>>> temporary >>>> tables, causing the bloat. Or is there something I'm missing? >>> >>> >>> Wouldn't more aggressive vacuuming of catalog tables fix the bloat? >>> >>> Perhaps reserving a worker or N to run only on catalog schemas? >>> >>> That'd be far simpler. >> >> >> Maybe, although IIRC the issues with catalog bloat were due to a combination >> of long queries and many temporary tables being created/dropped. In that >> case simply ramping up autovacuum (or even having a dedicated workers for >> catalogs) would not realy help due to the xmin horizon being blocked by the >> long-running queries. >> >> Maybe it's entirely crazy idea due to the wine I drank at the dinner, but >> couldn't we vacuum the temporary table records differently? For example, >> couldn't we just consider them removable as soon as the backend that owns >> them disappears? > > Or perhaps go all the way and generalize that to rows that never > become visible outside their parent transaction. > > As in, delete of rows created by the deleting transaction could clean > up, carefully to avoid voiding indexes and all that, but more > aggressively than regular deletes. > Maybe, but I wouldn't be surprised if such generalization would be an order of magnitude more complicated - and even the vacuuming changes I mentioned are undoubtedly a fair amount of work. Sadly, I don't see how this might fix the other issues mentioned in this thread (e.g. impossibility to create temp tables on standbys), regards -- Tomas Vondra http://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