Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jNwOc-00041U-6j for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Apr 2020 10:32:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jNwOb-0005vc-3P for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Apr 2020 10:32:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jNwOa-0005rJ-Jr for pgsql-hackers@lists.postgresql.org; Mon, 13 Apr 2020 10:32:52 +0000 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jNwOT-0003Rw-Hi for pgsql-hackers@postgresql.org; Mon, 13 Apr 2020 10:32:51 +0000 Received: by mail-lf1-x143.google.com with SMTP id l11so6157889lfc.5 for ; Mon, 13 Apr 2020 03:32:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=mNJkf2CX19Mzy12Cna36vKkhVUg3PS7U0f6al2mm+es=; b=AIcMK+r1Qj2MXMMrcYUDZgUbYOKj5ZE1tK1HOmAinLK254+/wF4FxqFrbHuVmMh7kd AlR5emPNaLzNkd5zzU/Y8tx5y+gSFu7tFne/SfZyXooZc+XgFOXD+TIk1z6FEMoRfBwT dJaN8oq6WffNBc3BMd0aNrNGuVjLzQqSxZepRhNpU+9lQVJkVqKVW7aO38cACZzoRC6Y IQ6412tRLdlVIOeNFdCbkhaz4rU8JJod49srVcHufAub+NujxQWaYHF6/ePZcQKM50Td RSZ27/ZiUklOiRFAQar9XEeYvfQX+nzcyUi3QRS1EaozTwWh619LbAqKuPfzqiX4HaDS qDjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=mNJkf2CX19Mzy12Cna36vKkhVUg3PS7U0f6al2mm+es=; b=ikA0B7LfXyyIxo6U/MbhoDnMWqQ+NARkLZLhx+TTAw7KUmYJkKO2vdnhDo2EDHo8e4 5opTTRjP39+L8dTvJx+RpR68lPSGHZQ8hE7dvWGZaWDM3O7pChTBpRciuHe/c6Q9BVE9 rdYNkxG6o+Aedhjt4U3XCDJcI5V64A6wUWd8LW8UJP63pf1k6Gth3++MRHJI0XIQib4W CHcVG9ntyJQ0YyqZTFdbfsR+t5i487zW8k6mZlkiAYXEZjGsfbc/4Re2LnUXQMakGZIM MeobfcC8Dew66ySHtKwRq84WruFEUSPepDctyVNwC0KG1fwYsmPgGPjTHq90FK8qzozO Ohxg== X-Gm-Message-State: AGi0PuZUpWFRdz1DSIBwToQYhk2XBKJnVQ4noIJl/DdLb45be7j8Of2S S+HsodaoZ30w37zPI7cAhzDAwT1dqPsVj/MBvOBe8Ny/CbeXZLYhd3JmAlpHcMtYDcECk3DDwZA oJmQH9PrtI6nHOCLh0JHukh+YLWLcMBKLkmnedUO1ngzlFNBHFTEHKNXFBmePh6WfL4KZiJCBdX gqbMOuozHzGQwsmW0vjaKRJ8cn7KGDgQ== X-Google-Smtp-Source: APiQypL6xrYk9RKCfUbPrhYxdhDYgPPW/e3y4rMUfbzW52reB3ue/plwJzWJDklmcoMCPp+sP5FBrg== X-Received: by 2002:ac2:58cb:: with SMTP id u11mr10056699lfo.185.1586773963942; Mon, 13 Apr 2020 03:32:43 -0700 (PDT) Received: from localhost.localdomain ([157.47.27.135]) by smtp.gmail.com with ESMTPSA id w3sm8522559ljm.0.2020.04.13.03.32.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Apr 2020 03:32:43 -0700 (PDT) Subject: Re: [Proposal] Global temporary tables To: =?UTF-8?B?5pu+5paH5peM?= Cc: Pavel Stehule , Robert Haas , Prabhat Sahu , Tomas Vondra , Konstantin Knizhnik , PostgreSQL Hackers , =?UTF-8?B?6JSh5p2+6Zyy?= =?UTF-8?B?KOWtkOWYiSk=?= , "Cai, Le" , =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= References: <24099f4e-742c-e92b-729c-77bac1ca80d4@postgrespro.ru> <3fef844f-0e73-8fcb-e4b6-595d6317b191@postgrespro.ru> <20200112015109.caab6qdr2ob6d5jv@development> <9262B679-EA73-495E-82A6-508F5625023F@alibaba-inc.com> <8517A6EA-17A6-4160-8987-B01073A0ECAF@alibaba-inc.com> <8BC7841E-3B32-4518-9586-D9ED571F4922@alibaba-inc.com> <80DC3BA7-E5C0-43CA-A66C-2CCB45C10EA7@alibaba-inc.com> From: tushar Message-ID: <953705a7-52df-4b7e-a7b5-675a6303a262@enterprisedb.com> Date: Mon, 13 Apr 2020 16:02:30 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <80DC3BA7-E5C0-43CA-A66C-2CCB45C10EA7@alibaba-inc.com> Content-Type: multipart/alternative; boundary="------------2800E004EA9E71E5D9035A3C" Content-Language: en-US X-CLOUD-SEC-AV-Info: edb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------2800E004EA9E71E5D9035A3C Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 4/9/20 6:26 PM, 曾文旌 wrote: >> On 4/7/20 2:27 PM, 曾文旌 wrote: >>> Vacuum full GTT, cluster GTT is already supported in global_temporary_table_v24-pg13.patch. >> Here , it is skipping GTT >> >> postgres=# \c foo >> You are now connected to database "foo" as user "tushar". >> foo=# create global temporary table g123( c1 int) ; >> CREATE TABLE >> foo=# \q >> [tushar@localhost bin]$ ./vacuumdb --full foo >> vacuumdb: vacuuming database "foo" >> WARNING: skipping vacuum global temp table "g123" because storage is not initialized for current session > The message was inappropriate at some point, so I removed it. > Thanks Wenjing. Please see -if this below behavior is correct X terminal - postgres=# create global temp table foo1(n int); CREATE TABLE postgres=# insert into foo1 values (generate_series(1,10)); INSERT 0 10 postgres=# vacuum full ; VACUUM Y Terminal - [tushar@localhost bin]$ ./vacuumdb -f  postgres vacuumdb: vacuuming database "postgres" WARNING:  global temp table oldest relfrozenxid 3276 is the oldest in the entire db DETAIL:  The oldest relfrozenxid in pg_class is 3277 HINT:  If they differ greatly, please consider cleaning up the data in global temp table. WARNING:  global temp table oldest relfrozenxid 3276 is the oldest in the entire db DETAIL:  The oldest relfrozenxid in pg_class is 3277 HINT:  If they differ greatly, please consider cleaning up the data in global temp table. -- regards,tushar EnterpriseDB https://www.enterprisedb.com/ The Enterprise PostgreSQL Company --------------2800E004EA9E71E5D9035A3C Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 4/9/20 6:26 PM, 曾文旌 wrote:
On 4/7/20 2:27 PM, 曾文旌 wrote:
Vacuum full GTT, cluster GTT is already supported in global_temporary_table_v24-pg13.patch.
Here , it is skipping GTT

postgres=# \c foo
You are now connected to database "foo" as user "tushar".
foo=# create global temporary table  g123( c1 int) ;
CREATE TABLE
foo=# \q
[tushar@localhost bin]$ ./vacuumdb --full  foo
vacuumdb: vacuuming database "foo"
WARNING:  skipping vacuum global temp table "g123" because storage is not initialized for current session
The message was inappropriate at some point, so I removed it.

Thanks Wenjing. Please see -if this below behavior is correct

X terminal -

postgres=# create global temp table foo1(n int);
CREATE TABLE
postgres=# insert into foo1 values (generate_series(1,10));
INSERT 0 10
postgres=# vacuum full ;
VACUUM

Y Terminal -

[tushar@localhost bin]$ ./vacuumdb -f  postgres
vacuumdb: vacuuming database "postgres"
WARNING:  global temp table oldest relfrozenxid 3276 is the oldest in the entire db
DETAIL:  The oldest relfrozenxid in pg_class is 3277
HINT:  If they differ greatly, please consider cleaning up the data in global temp table.
WARNING:  global temp table oldest relfrozenxid 3276 is the oldest in the entire db
DETAIL:  The oldest relfrozenxid in pg_class is 3277
HINT:  If they differ greatly, please consider cleaning up the data in global temp table.


-- 
regards,tushar
EnterpriseDB  https://www.enterprisedb.com/
The Enterprise PostgreSQL Company
--------------2800E004EA9E71E5D9035A3C--