Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcJwt-0006xl-2I for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Aug 2016 22:13:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bcJws-0000ss-DI for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Aug 2016 22:13:34 +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 1bcJvT-0007nF-8o for pgsql-hackers@postgresql.org; Tue, 23 Aug 2016 22:12:07 +0000 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bcJvP-0004np-A8 for pgsql-hackers@postgresql.org; Tue, 23 Aug 2016 22:12:06 +0000 Received: by mail-wm0-x234.google.com with SMTP id i5so2063088wmg.0 for ; Tue, 23 Aug 2016 15:12:02 -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=lYkzztlVFe0avM/OMcClFg1z/1RaZ6iO0gEg7KIr5jw=; b=JMkz8aQnOKbgqU6bMUt6tQh0bxgUoi4an3YAk0krYohltvcFhb0wyCqxTohlGlCxAx S18cheVgEdJfzYsWZpNlvWQUaJ10NPNQ0LDKYbC9dYnL5aaafK4rU7u5PRp3Ts5VhSt0 UrFfUW/g1ompS6lJkh/OvGXAtO4Lr4VTVb+uho1QIGP2cU6QysyaKtZdGUMvQxOgsyEI WBVJrOyEJZD8A6qDg0VdDvT9LHil0ruAuYnrSWElDsjprAn+or6q2JcKJiT5KWvq+Gz5 lEX5b0zrHqlqlTRjRuYUY8RmVjB0iucpnjrwm1YzBcRirf5tH93fJTYKxszkNhOdazhL lzYw== 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=lYkzztlVFe0avM/OMcClFg1z/1RaZ6iO0gEg7KIr5jw=; b=W7fmvj5wFLYKdG5xZNx+7uoQ+ddMVLHut4qGCk19WVsNY5fMX3bBEgd5cxek6DYRs6 O+mEHT0aG4yDxkINVl5Ex5rK2LZpT7daXOnYEQ049V0WOMv3lmWig/mR+TnLQdkMfTp/ OAiIOP0g26sLj+R7T4gcGekjXDJGCeRgP0dFsawYfPXBNR57y9VArDYODgs65jGXiZy3 cabPtxR2nEMxg4uGe69m/jvOW455EO3yCgm6V2wYfnZbu0zxEEUFPIu6X//vfDUZFPIT ZLGen1FBkLgKuC/0OMoq6/qyg9DjIM2DLy9W+YhU33LtTlhNBRgihYYVBb6uohGwdAw8 81BA== X-Gm-Message-State: AEkooutS3B/z0rcpcrGyBecwR5jdkMlPiSVUtjwvzTq110QM+9uhUngfjYg2TRzTZwVvkM3XaqwPBmVpR9oQhXYfyL04WfQ1z2IUJaQXAFeHRdY7BzjAoyz8HMYc2HdGMqIRtPtJ4DVdFMR7WYfYPgslE6WxkeM+It9CiRJsgJ3k53PnNaPgAqBgQrHy40hcWS2nAyr05F5R X-Received: by 10.194.87.67 with SMTP id v3mr23058454wjz.103.1471990321416; Tue, 23 Aug 2016 15:12:01 -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 p4sm6148819wjq.27.2016.08.23.15.11.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Aug 2016 15:12:00 -0700 (PDT) Subject: Re: [Patch] Temporary tables that do not bloat pg_catalog (a.k.a fast temp tables) To: Robert Haas , Jim Nasby References: <20160801124531.66cde374@fujitsu> <26c3bc60-6613-e7ab-517a-53136f01fb6c@2ndquadrant.com> <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> Cc: Aleksander Alekseev , PostgreSQL Hackers From: Tomas Vondra Message-ID: Date: Wed, 24 Aug 2016 00:11:49 +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/22/2016 10:32 PM, Robert Haas wrote: > > ... > > 1. The number of tables for which we would need to add a duplicate, > unlogged table is formidable. You need pg_attribute, pg_attrdef, > pg_constraint, pg_description, pg_type, pg_trigger, pg_rewrite, etc. > And the backend changes needed so that we used the unlogged copy for > temp tables and the permanent copy for regular tables is probably > really large. > > 2. You can't write to unlogged tables on standby servers, so this > doesn't help solve the problem of wanting to use temporary tables on > standbys. > > 3. While it makes creating temporary tables a lighter-weight > operation, because you no longer need to write WAL for the catalog > entries, there's probably still substantially more overhead than just > stuffing them in backend-local RAM. So the performance benefits are > probably fairly modest. > > Overall I feel like the development effort that it would take to make > this work would almost certainly be better-expended elsewhere. But of > course I'm not in charge of how people who work for other companies > spend their time... > 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? -- 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