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 1ioQ9U-0006GK-GE for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2020 11:02:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ioQ8V-0002ec-3Q for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2020 11:01:27 +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 1ioQ8U-0002cM-JO for pgsql-hackers@lists.postgresql.org; Mon, 06 Jan 2020 11:01:26 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ioQ8R-0004ro-NL for pgsql-hackers@postgresql.org; Mon, 06 Jan 2020 11:01:25 +0000 Received: by mail-wr1-x444.google.com with SMTP id y17so49154114wrh.5 for ; Mon, 06 Jan 2020 03:01:23 -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:content-transfer-encoding:in-reply-to; bh=0XgOM7qSYes/8Jrxj03Pbb48mRrJXMZYAZlg3ekLBmM=; b=PNTF6KY33ZG/yPw7L5Zs3ABrbXWRwoxi19wUBtXjWq8SP4Pw2/+zFyLn0GwJyimjij JmiWui7PnweLtDNXwXbXREyzSHLyZ+QC//ipeKUdGm3krNolprkKyQN4ssHTXxJmWe3T 612+lOX0/grEyVZVfiChzlxmQXEjVEExScBoia4fpqTrbkHXlkcw3jHRX1EF9mWgU4RS JrVujRYRSTwRCYTsCodTtgeC0d3Hygg9YYntGkDFJddvULht0QJKC1DOS3CSPkA5jrVn x01IgBCnGtD+z8dSS92GjWPleQbAkvdUp6EGS2u8I5Xw9iXmvLVLzbAUC5k3tyMc7FAz gxKg== 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:content-transfer-encoding :in-reply-to; bh=0XgOM7qSYes/8Jrxj03Pbb48mRrJXMZYAZlg3ekLBmM=; b=E0vw6xByka8ZAyYw4E+pWxvFXjbdBKbmGqH8KYpgVAX7S662nBPaYRCACuzT925Zo3 qDFvExBnh6XjJcnnEomCs6+Xt416e+KAeEtpuS8RyFXtTSFMTfSXvHYukayGjfZOdn+G OXz2mmCojFHXSgHRr0mo5bHzEtmC776xqMqJNiVwOGGhV4QQ4vPvcz/An9AwwRmo5+LO gYnU4DXP3eajJogVKpwh7euWYMaeOp5bpF+KHkaLdkU6dp7HtqU//iygwwfIqbfhN/O0 4O8g+nO0U9vv+TWsBcvuvRGyTOBjlMQt1F62/QCGEsrGTV7UqxCwj2H4ioCAPfC8uN/Q 9gmQ== X-Gm-Message-State: APjAAAWT3yVNcLcTwZCrevcVDebGm59PJxq6rS1glrxh3Eiq/br+JTnE bbbwiDu1FngrJRYmTD3Nhm2ZTQ== X-Google-Smtp-Source: APXvYqzpmsPuMsyWBmdUSIF70V9wsoW3Sbh75a5OhbWpcWLXM1KPbgHH9+GleRCMUF+kCg58SKYw9w== X-Received: by 2002:adf:e547:: with SMTP id z7mr105209876wrm.258.1578308482142; Mon, 06 Jan 2020 03:01:22 -0800 (PST) Received: from localhost (ip-86-49-253-92.net.upcbroadband.cz. [86.49.253.92]) by smtp.gmail.com with ESMTPSA id h8sm74633606wrx.63.2020.01.06.03.01.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 03:01:21 -0800 (PST) Date: Mon, 6 Jan 2020 12:01:19 +0100 From: Tomas Vondra To: =?utf-8?B?5pu+5paH5peMKOS5ieS7jik=?= Cc: Konstantin Knizhnik , 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: <20200106110119.zfrg2m5e2q5mvi5v@development> References: <1A1A6EDC-D0EC-47B0-BD21-C2ACBAEA65E4@alibaba-inc.com> <0ef6f482-11ce-a99f-207e-26fa3f2f56db@postgrespro.ru> <24099f4e-742c-e92b-729c-77bac1ca80d4@postgrespro.ru> <80cf30c2-ebd5-a568-9f62-a970e4d91326@postgrespro.ru> <5767433E-1A77-4682-B3FD-4869911021C8@alibaba-inc.com> <6b7570aa-14ea-2f28-c3b5-74dd785bbafe@postgrespro.ru> <20200105200603.wrb4beacwb57hhpk@development> <33969545-BEF7-4518-A741-302CBF7FF269@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <33969545-BEF7-4518-A741-302CBF7FF269@alibaba-inc.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Jan 06, 2020 at 01:04:15PM +0800, 曾文旌(义从) wrote: >In the previous communication > >1 we agreed on the general direction >1.1 gtt use local (private) buffer >1.2 no replica access in first version > OK, good. >2 We feel that gtt needs to maintain statistics, but there is no >agreement on what it will be done. > I certainly agree GTT needs to maintain statistics, otherwise it'll lead to poor query plans. AFAIK the current patch stores the info in a hash table in a backend private memory, and I don't see how else to do that (e.g. storing it in a catalog would cause catalog bloat). FWIW this is a reasons why I think just using shared buffers (instead of local ones) is not sufficient to support parallel queriesl as proposed by Alexander. The workers would not know the stats, breaking planning of queries in PARALLEL SAFE plpgsql functions etc. >3 Still no one commented on GTT's transaction information processing, they include >3.1 Should gtt's frozenxid need to be care? >3.2 gtt’s clog clean >3.3 How to deal with "too old" gtt data > No idea what to do about this. >I suggest we discuss further, reach an agreement, and merge the two patches to one. > OK, cool. Thanks for the clarification. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services