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 1kiCKm-0005bP-1U for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Nov 2020 08:08:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kiCKl-0004LS-1c for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Nov 2020 08:08:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ki7Qy-0002dc-GC for pgsql-hackers@lists.postgresql.org; Thu, 26 Nov 2020 02:55:00 +0000 Received: from out0-137.mail.aliyun.com ([140.205.0.137]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ki7Qt-00053G-BZ for pgsql-hackers@postgresql.org; Thu, 26 Nov 2020 02:54:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alibaba-inc.com; s=default; t=1606359290; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:To; bh=/FahGv/HbB4A8KhS3/drFSjpR51p6INxyiXGZaSQXm8=; b=pHvFRnySWzSzqc4tCobW0iZhEYkoGDAPJSRcmrb1CYRhO31nNgv4S0PTtUpeUsgUKSPEBxcRHzTtF/IHrZ04H0rAD+KJYFITfwY4fR49YsIai27GM+atim3ji1B6m6ogyWk9Aa5jeqja41WjuVfQv1nNp1SJopKi8st7JZjZZ7s= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047192;MF=wenjing.zwj@alibaba-inc.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---.J.J0b4T_1606359286; Received: from 30.225.184.169(mailfrom:wenjing.zwj@alibaba-inc.com fp:SMTPD_---.J.J0b4T_1606359286) by smtp.aliyun-inc.com(127.0.0.1); Thu, 26 Nov 2020 10:54:46 +0800 From: =?utf-8?B?5pu+5paH5peM?= Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_04C0DD41-8D25-4A4A-AA73-819C557DAD74"; protocol="application/pkcs7-signature"; micalg=sha-256 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.21\)) Subject: Re: [Proposal] Global temporary tables Date: Thu, 26 Nov 2020 10:54:46 +0800 In-Reply-To: Cc: Robert Haas , Konstantin Knizhnik , "movead.li@highgo.ca" , Prabhat Sahu , tushar , Tomas Vondra , PostgreSQL Hackers To: Pavel Stehule References: <24099f4e-742c-e92b-729c-77bac1ca80d4@postgrespro.ru> <77320A29-DC39-4EFE-A5E2-0A00F6A316E8@alibaba-inc.com> <7eb93026-0f35-325a-132f-ca183a5da3ac@enterprisedb.com> <7CCE7DE5-5E85-4155-9010-5EDEAE762194@alibaba-inc.com> <087bd809-e1d7-ee44-da1f-25996abad442@enterprisedb.com> <40391A22-CB8B-4143-B936-7707667F7905@alibaba-inc.com> <68FC0EB3-8E39-4300-B9ED-036F4163C791@alibaba-inc.com> <25D7E36F-B2D6-4A63-BFC7-E1FD24EA6BE0@alibaba-inc.com> <507b246f-4350-f4af-3950-a334be7c2cf2@enterprisedb.com> <06844F6A-0BD2-438E-95E5-E76E4CB5CA57@alibaba-inc.com> <750A0445-7FE0-4B4D-A319-AC1A8C7249EB@alibaba-inc.com> <9EBDB104-42CD-409E-BB27-D14AB0858AE4@alibaba-inc.com> <6FBF19E7-1C3E-4F83-AA37-778F2A285AD9@alibaba-inc.com> <318BAF11-FE5A-4CE0-9286-3695F9AD0A8A@alibaba-inc.com> <53F385F1-E0D6-4FE1-9B33-7EFDD77A1FF2@alibaba-inc.com> <196359A8-9363-4D87-A6B1-F52AC6FEA9D3@gmail.com> <63150AD0-8D14-44C4-8B17-8775B5A9531C@alibaba-inc.com> X-Mailer: Apple Mail (2.3654.20.0.2.21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_04C0DD41-8D25-4A4A-AA73-819C557DAD74 Content-Type: multipart/alternative; boundary="Apple-Mail=_E090E4CD-CA55-41AB-85EB-21A1C68FC0DF" --Apple-Mail=_E090E4CD-CA55-41AB-85EB-21A1C68FC0DF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I found that the new Patch mail failed to register to Commitfest https://commitfest.postgresql.org/28/2349/# = I don't know what's wrong and how to check it? Could you help me figure it out? > 2020=E5=B9=B411=E6=9C=8825=E6=97=A5 14:19=EF=BC=8CPavel Stehule = =E5=86=99=E9=81=93=EF=BC=9A >=20 >=20 >=20 > po 23. 11. 2020 v 10:27 odes=C3=ADlatel =E6=9B=BE=E6=96=87=E6=97=8C = > = napsal: >=20 >=20 >> 2020=E5=B9=B411=E6=9C=8821=E6=97=A5 02:28=EF=BC=8CPavel Stehule = > =E5=86=99=E9=81= =93=EF=BC=9A >>=20 >> Hi >>=20 >> p=C3=A1 11. 9. 2020 v 17:00 odes=C3=ADlatel =E6=9B=BE=E6=96=87=E6=97=8C= > = napsal: >> I have written the README for the GTT, which contains the GTT = requirements and design. >> I found that compared to my first email a year ago, many GTT = Limitations are now gone. >> Now, I'm adding comments to some of the necessary functions. >>=20 >> There are problems with patching. Please, can you rebase your patch? > Sure. > I'm still working on sort code and comments. > If you have any suggestions, please let me know. >=20 > It is broken again=20 >=20 > There is bad white space >=20 > + /* > + * For global temp table only > + * use ShareUpdateExclusiveLock for ensure safety > + */ > + { > + { > + "on_commit_delete_rows", > + "global temp table on commit options", > + RELOPT_KIND_HEAP | RELOPT_KIND_PARTITIONED, > + ShareUpdateExclusiveLock > + }, > + true > + }, <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > /* list terminator */ > {{NULL}} >=20 > +7 OTHERS > +Parallel query > +Planner does not produce parallel query plans for SQL related to GTT. = Because <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > +GTT private data cannot be accessed across processes. > diff --git a/src/backend/catalog/Makefile = b/src/backend/catalog/Makefile >=20 >=20 > +/* > + * Update global temp table relstats(relpage/reltuple/relallvisible) = <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + * to local hashtable > + */ > +void >=20 > +/* > + * Search global temp table relstats(relpage/reltuple/relallvisible) = <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + * from lo >=20 > and there are lot of more places ... >=20 > I found other issue >=20 > postgres=3D# create global temp table foo(a int); > CREATE TABLE > postgres=3D# create index on foo(a); > CREATE INDEX >=20 > close session and in new session >=20 > postgres=3D# reindex index foo_a_idx ; > WARNING: relcache reference leak: relation "foo" not closed > REINDEX >=20 > Regards >=20 > Pavel >=20 >=20 >=20 >=20 > Wenjing >=20 >=20 >>=20 >> Regards >>=20 >> Pavel >>=20 >>=20 >>=20 >> Wenjing >>=20 >>=20 >>=20 >>=20 >>=20 >> > 2020=E5=B9=B47=E6=9C=8831=E6=97=A5 =E4=B8=8A=E5=8D=884:57=EF=BC=8CRob= ert Haas > = =E5=86=99=E9=81=93=EF=BC=9A >> >=20 >> > On Thu, Jul 30, 2020 at 8:09 AM wenjing zeng > wrote: >> >> Please continue to review the code. >> >=20 >> > This patch is pretty light on comments. Many of the new functions = have >> > no header comments, for example. There are comments here and there = in >> > the body of the new functions that are added, and in places where >> > existing code is changed there are comments here and there, but >> > overall it's not a whole lot. There's no documentation and no = README, >> > either. Since this adds a new feature and a bunch of new = SQL-callable >> > functions that interact with that feature, the feature itself = should >> > be documented, along with its limitations and the new SQL-callable >> > functions that interact with it. I think there should be either a >> > lengthy comment in some suitable file, or maybe various comments in >> > various files, or else a README file, that clearly sets out the = major >> > design principles behind the patch, and explaining also what that >> > means in terms of features and limitations. Without that, it's = really >> > hard for anyone to jump into reviewing this code, and it will be = hard >> > for people who have to maintain it in the future to understand it, >> > either. Or for users, for that matter. >> >=20 >> > --=20 >> > Robert Haas >> > EnterpriseDB: http://www.enterprisedb.com = >> > The Enterprise PostgreSQL Company --Apple-Mail=_E090E4CD-CA55-41AB-85EB-21A1C68FC0DF Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

I found that the new Patch mail failed = to register to Commitfest
I don't know what's wrong and how to check it?
Could you help me figure it out?



2020=E5=B9=B411=E6=9C=8825=E6=97=A5 14:19=EF=BC=8CPavel = Stehule <pavel.stehule@gmail.com> =E5=86=99=E9=81=93=EF=BC=9A


po 23. 11. 2020 = v 10:27 odes=C3=ADlatel =E6=9B=BE=E6=96=87=E6=97=8C <wenjing.zwj@alibaba-inc.com> napsal:


2020=E5=B9=B411=E6=9C=8821=E6=97=A5 02:28=EF=BC=8CPavel = Stehule <pavel.stehule@gmail.com> =E5=86=99=E9=81=93=EF=BC=9A
Hi

p=C3=A1 11. = 9. 2020 v 17:00 odes=C3=ADlatel =E6=9B=BE=E6=96=87=E6=97=8C <wenjing.zwj@alibaba-inc.com> napsal:
I have = written the README for the GTT, which contains the GTT requirements and = design.
I found that compared to my first email a year = ago, many GTT Limitations are now gone.
Now, I'm adding = comments to some of the necessary functions.

There are problems with patching. Please, can you rebase your = patch?
Sure.
I'm still working on sort code and comments.
If you have any suggestions, please let me = know.

It is broken again 

There is bad white = space

+   = /*
+    * For global temp table only
+    * use ShareUpdateExclusiveLock for ensure = safety
+    */
+   {
+       {
+       =     "on_commit_delete_rows",
+     =       "global temp table on commit options",
+           RELOPT_KIND_HEAP | = RELOPT_KIND_PARTITIONED,
+         =   ShareUpdateExclusiveLock
+       = },
+       true
+   = },  <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
    /* list terminator */
  =   {{NULL}}

+7 OTHERS
+Parallel query
+Planner = does not produce parallel query plans for SQL related to GTT. Because = <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
+GTT= private data cannot be accessed across processes.
diff = --git a/src/backend/catalog/Makefile = b/src/backend/catalog/Makefile


+/*
+ * Update global temp table = relstats(relpage/reltuple/relallvisible) <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
+ * to local = hashtable
+ */
+void

+/*
+ * Search global = temp table relstats(relpage/reltuple/relallvisible) = <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
+ * from = lo

and there = are lot of more places ...

I found other issue

postgres=3D# create = global temp table foo(a int);
CREATE TABLE
postgres=3D# create index on foo(a);
CREATE = INDEX

close = session and in new session

postgres=3D# reindex index foo_a_idx ;
WARNING: =  relcache reference leak: relation "foo" not closed
REINDEX

Regards

Pavel




Wenjing



Regards

Pavel



Wenjing





> = 2020=E5=B9=B47=E6=9C=8831=E6=97=A5 =E4=B8=8A=E5=8D=884:57=EF=BC=8CRobert = Haas <robertmhaas@gmail.com> =E5=86=99=E9=81=93=EF=BC=9A
> 
> On Thu, Jul 30, 2020 at 8:09 AM wenjing zeng <wjzeng2012@gmail.com> wrote:
>> = Please continue to review the code.
> 
> This = patch is pretty light on comments. Many of the new functions have
> no header comments, for example. There are comments here = and there in
> the body of the new functions that are = added, and in places where
> existing code is changed = there are comments here and there, but
> overall it's = not a whole lot. There's no documentation and no README,
> either. Since this adds a new feature and a bunch of new = SQL-callable
> functions that interact with that = feature, the feature itself should
> be documented, = along with its limitations and the new SQL-callable
> = functions that interact with it. I think there should be either a
> lengthy comment in some suitable file, or maybe various = comments in
> various files, or else a README file, = that clearly sets out the major
> design principles = behind the patch, and explaining also what that
> means = in terms of features and limitations. Without that, it's really
> hard for anyone to jump into reviewing this code, and it = will be hard
> for people who have to maintain it in = the future to understand it,
> either. Or for users, = for that matter.
> 
> -- 
> Robert = Haas
> EnterpriseDB: http://www.enterprisedb.com
> The = Enterprise PostgreSQL = Company

= --Apple-Mail=_E090E4CD-CA55-41AB-85EB-21A1C68FC0DF-- --Apple-Mail=_04C0DD41-8D25-4A4A-AA73-819C557DAD74 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCBusw ggM6MIICo6ADAgECAgEDMA0GCSqGSIb3DQEBBQUAMIGQMSYwJAYJKoZIhvcNAQkBFhdhbGlsYW5n QGFsaWJhYmEtaW5jLmNvbTETMBEGA1UEAwwKQWxpbGFuZyBDQTEMMAoGA1UECwwDSW5jMRAwDgYD VQQKDAdBbGliYWJhMREwDwYDVQQHDAhIYW5nWmhvdTERMA8GA1UECAwIWmhlSmlhbmcxCzAJBgNV BAYTAkNOMB4XDTE0MDMyMTE4MjY0OFoXDTM0MDMxNjE4MjY0OFowPzEdMBsGA1UEAwwUQWxpbGFu ZyBDbGFzcyAzIFJvb3QxDDAKBgNVBAsMA0luYzEQMA4GA1UECgwHQWxpYmFiYTCBnzANBgkqhkiG 9w0BAQEFAAOBjQAwgYkCgYEA5EmVMYbK8q7pcO0oTDWAbhetfpZGE9f8nZgF8jMjF4UhmiiaOqJ6 nbovFt1/E2eOBOWTBDDN6029KN/rejdhvarLW6X5v8J8ZTbHRSgWQEKbE6e2Cg2lRqNYjIq+jROV V7ZWXGZX3Vy53ABsRiAyE3+vu571llNnkAgHXhh+PosCAwEAAaOB8zCB8DAdBgNVHQ4EFgQUvBg5 59PY0tRSklvSA+Es4n8PWzUwgb0GA1UdIwSBtTCBsoAUbEKnBvQw5utZdaHNpiloheRi1K2hgZak gZMwgZAxJjAkBgkqhkiG9w0BCQEWF2FsaWxhbmdAYWxpYmFiYS1pbmMuY29tMRM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