Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bfDFi-0007YL-R3 for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Aug 2016 21:40:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bfDFi-00014r-Ab for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Aug 2016 21:40:58 +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 1bfDFh-00014j-GO for pgsql-hackers@postgresql.org; Wed, 31 Aug 2016 21:40:57 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bfDFa-00075y-8P for pgsql-hackers@postgresql.org; Wed, 31 Aug 2016 21:40:56 +0000 Received: by mail-wm0-x233.google.com with SMTP id d196so10116476wmd.0 for ; Wed, 31 Aug 2016 14:40:49 -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=Kapcj3dLVve6sQ3dOn5b47X7mEe5b8GbLcLx2uZn++A=; b=SHpu9X8hamLuS/FTq/XmRkYLDmgqwzIgjWur/5KonUshUu5Fxlu86o3x/6a+YpDcXr nacPE+stK8V71gXb3HpEkhQ6d8rMhMQauoW8VL71ZtwNPo1wBQolP0YuI1TWVHAO2lQX UvmvP6edGCJ5KgCxMVnNWZ5vni/pnxCRWCpaNBUYT2D2fD/CDer3KNKFSF79AxMz6NFW fI4PiYHMZIuZsm0eXgsIqlUxeSWYxkcBY5hc2YjYYOaJCmI8JaEN+kzQArfRafGmv3ma BBxEj+seCftPnwTIyEuJIZNBvj+2KOjdNjTQQOH2yzR4yOv6BaIyJQu27E0g97dLI7j+ 9TQg== 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=Kapcj3dLVve6sQ3dOn5b47X7mEe5b8GbLcLx2uZn++A=; b=IX+rzdEZ3Qx9VGj+fQcQ6IU9RXHa/kCsFI1pPoBWRW878wR5EAwchmMODWrERGDIcS 5ISsXXmYIqM4y0nufPaddy+kXArKJ28w0JrRYTjPbtsP5MKojuecFswBGujQPokE0r3z 29MXj67obItfv+aZzUtmotvLET9mqLI3c3tctPjLejuGUzN5dAmA0qg5EuqNPWrmwPp0 DdA144WLnopJ1dEzTUDjkxruUbZlvVCcuk0jeEKriuZJbjX9Rkz0eby1Hq9SVop6O/Vd pO39R6ivlW/UMpJxNr2YNJQtnTqUd8pGlj5GgEBU7v3c4g1JFxCdohWQdPPcDbCXWFmz EfhQ== X-Gm-Message-State: AE9vXwPpMKmZ8CqbxFWcf1rO3YPZWNJzfuUNqCKU3ZTnGOtZDqAFgDbZtSsszZ6Sc6Xp4TfiylB+88iFNxlwNfeCeSc+n5FxAo8cFEV9PnBZDKdGrMtjKmHmNZ+QVDkUI5yxIFQvyJ31xJWQnu22+fHYGQKih1k4FtEHVtmbZeiOIK0ejKmY8RiVuo0L2RIYtM8u2d95Qpx9 X-Received: by 10.194.216.7 with SMTP id om7mr10266500wjc.135.1472679648983; Wed, 31 Aug 2016 14:40:48 -0700 (PDT) Received: from [10.137.2.20] (92-111-18-74.static.chello.nl. [92.111.18.74]) by smtp.gmail.com with ESMTPSA id p83sm10886657wma.18.2016.08.31.14.40.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Aug 2016 14:40:48 -0700 (PDT) Subject: Re: [Patch] Temporary tables that do not bloat pg_catalog (a.k.a fast temp tables) To: Vik Fearing , Robert Haas 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: Jim Nasby , Aleksander Alekseev , PostgreSQL Hackers From: Tomas Vondra Message-ID: <2bb00def-22bf-40a1-7dfb-6e72b99a351a@2ndquadrant.com> Date: Wed, 31 Aug 2016 23:40:46 +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 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/31/2016 09:20 PM, Vik Fearing wrote: > On 08/24/2016 06:16 PM, Robert Haas wrote: >> On Tue, Aug 23, 2016 at 6:11 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? >> >> No, not really. Jim just asked if the idea of partitioning the >> columns was completely dead in the water, and I said, no, you could >> theoretically salvage it. Whether that does you much good is another >> question. >> >> IMV, the point here is that you MUST have globally visible dependency >> entries for this to work sanely. If they're not in a catalog, they >> have to be someplace else, and backend-private memory isn't good >> enough, because that's not globally visible. Until we've got a >> strategy for that problem, this whole effort is going nowhere - even >> though in other respects it may be a terrific idea. > > Why not just have a regular-looking table, with a "global temporary" > relpersistence (I don't care which letter it gets) and when a backend > tries to access it, it uses its own private relfilenode instead of > whatever is in pg_class, creating one if necessary. That way the > structure of the table is fixed, with all the dependencies and whatnot, > but the content is private to each backend. What's wrong with this idea? > It's an improvement (and it's pretty much exactly what I proposed upthread). But it does not solve the problems with pg_statistic for example (each backend needs it's own statistics. So we'd either bloat the pg_statistic (if we manage to solve the problem that the table has the same oid in all backends), or we would need in-memory tuples (just like discussed in the thread so far). -- 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