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 1ir6rg-0000vm-0J for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jan 2020 21:03:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ir6re-0002uz-GV for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jan 2020 21:03:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ir6rd-0002up-W1 for pgsql-hackers@lists.postgresql.org; Mon, 13 Jan 2020 21:03:10 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ir6ra-0001k7-I3 for pgsql-hackers@postgresql.org; Mon, 13 Jan 2020 21:03:08 +0000 Received: by mail-wm1-x343.google.com with SMTP id d73so11388363wmd.1 for ; Mon, 13 Jan 2020 13:03:06 -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:references:mime-version :content-disposition:in-reply-to; bh=blkwX/KaX2VrM6oJu8843BvAjoa6bZlqFHNV2aGeztQ=; b=Bn+4ZRVCpTdRA8QXQw7nDnFGxEJogvtnCrZ+7wAPdLwcsuCebqju3bvvrl2mU5k0eW ulqKac/4ISz/8d3N7uwRtjfP3BtwHM3q7m6r1WvKAcRpBSQQb8Qr55hBj4njfdEaVpzb uPwsY1m29F8/brLDr4Hxuj2CdBWkeil88nCYN95AXHEdD6bEjpGYMWMAr/5z/hjhnuZA 8IwBU+5nYHjWcaryZ0Ll1JQWZNgqPM9B5An6w8umGjuJ0AMulZmgFw0iGkkbGdD6Qi6B +rDdE7MZy3fCogXQa1puGlaKGbN5RFIm5Voo5ff2KFobYvoCiyi/bh0e0IwAn9OJ33kR x7qw== 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:references :mime-version:content-disposition:in-reply-to; bh=blkwX/KaX2VrM6oJu8843BvAjoa6bZlqFHNV2aGeztQ=; b=BpEiqyiI4doOVe4S66GR9uJX5a+6GExlaByfdHAfFGDweUCo1sgyRYoL2NnxM9WeYO ClaPrkIRDiSHI8GMjv0UP0FQUSMvlPnxrMKWGvyfxBbEi4S/P7g68Jo6UOgwD52TNjp3 2wxMo9IQahJf0a3BC3PGDRHTIosPjgza5CvioyJKRd8pRdt/n/f4YS854JcayZHEBYId c9/9AJN46fOxr5LyykfS2ZZHbl42d83rN7Uh/WekRCeOkWdahfSgYV05rDlVqjheB72Z L6lMSYFjAWCmRp00BiPW4eKJpYUGjQVLNnWWGzegDr2Fics6W5MUX4gB9oKOtZDrBCGg ivrA== X-Gm-Message-State: APjAAAV6mxsa2gorjycZToWKH3R5dSkZdUNdKoQgbgopGE2zTtzYFIzQ vbX+9t3OBhILYUk62/i2Q3IaxQ== X-Google-Smtp-Source: APXvYqz2umD6aDgN4RFwr8WJXH07HKY7zk5WPArPLJMzhnI5SS31fNFLAYn4sptEZ/1//vCvvkf8Uw== X-Received: by 2002:a7b:c5cd:: with SMTP id n13mr22160559wmk.172.1578949384986; Mon, 13 Jan 2020 13:03:04 -0800 (PST) Received: from localhost (ip-86-49-253-92.net.upcbroadband.cz. [86.49.253.92]) by smtp.gmail.com with ESMTPSA id c17sm16581215wrr.87.2020.01.13.13.03.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2020 13:03:03 -0800 (PST) Date: Mon, 13 Jan 2020 22:03:01 +0100 From: Tomas Vondra To: Julien Rouhaud Cc: Konstantin Knizhnik , =?utf-8?B?5pu+5paH5peMKOS5ieS7jik=?= , Pavel Stehule , Robert Haas , PostgreSQL Hackers , =?utf-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?= , "Cai, Le" , =?utf-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= Subject: Re: [Proposal] Global temporary tables Message-ID: <20200113210301.yakqxdmxjh2ogq6x@development> References: <6b7570aa-14ea-2f28-c3b5-74dd785bbafe@postgrespro.ru> <20200105200603.wrb4beacwb57hhpk@development> <33969545-BEF7-4518-A741-302CBF7FF269@alibaba-inc.com> <0498c45c-53cb-d9b0-c1e2-7d2d1a618511@postgrespro.ru> <20200109164829.mdl3z5xalmaqxs67@development> <3fef844f-0e73-8fcb-e4b6-595d6317b191@postgrespro.ru> <20200112015109.caab6qdr2ob6d5jv@development> <20200113163253.ja34iqsors3o44sv@development> <20200113201216.GA17684@nol> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200113201216.GA17684@nol> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Jan 13, 2020 at 09:12:38PM +0100, Julien Rouhaud wrote: >On Mon, Jan 13, 2020 at 05:32:53PM +0100, Tomas Vondra wrote: >> On Mon, Jan 13, 2020 at 11:08:40AM +0300, Konstantin Knizhnik wrote: >> > >> >"if any code tried to access the statistics directly from the table, >> >rather than via the caches". >> > >> >Currently optimizer is accessing statistic though caches. So this >> >approach works. If somebody will rewrite optimizer or provide own >> >custom optimizer in extension which access statistic directly >> >then it we really be a problem. But I wonder why bypassing catalog >> >cache may be needed. >> > >> >> I don't know, but it seems extensions like hypopg do it. > >AFAIR, hypopg only opens pg_statistic to use its tupledesc when creating >statistics on hypothetical partitions, but it should otherwise never reads or >need plain pg_statistic rows. Ah, OK! Thanks for the clarification. I knew it does something with the catalog, didn't realize it only gets the descriptor. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services