Re: [Proposal] Global temporary tables - Mailing list pgsql-hackers

From 曾文旌(义从)
Subject Re: [Proposal] Global temporary tables
Date
Msg-id C7912E33-294F-4DFC-9CCC-5570590605C4@alibaba-inc.com
Whole thread Raw
In response to Re: [Proposal] Global temporary tables  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-hackers


2020年1月6日 下午8:17,Dean Rasheed <dean.a.rasheed@gmail.com> 写道:

On Mon, 6 Jan 2020 at 11:01, Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote:

On Mon, Jan 06, 2020 at 01:04:15PM +0800, 曾文旌(义从) wrote:

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.

+1

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).


It sounds like it needs a pair of system GTTs to hold the table and
column statistics for other GTTs. One would probably have the same
columns as pg_statistic, and the other just the relevant columns from
pg_class. I can see it being useful for the user to be able to see
these stats, so perhaps they could be UNIONed into the existing stats
view.
The current patch provides several functions as extension(pg_gtt) for read gtt statistics. 
Next I can move them to the kernel and let the view pg_stats can see gttstatistics.


Regards,
Dean

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: parallel vacuum options/syntax
Next
From: Adam Lee
Date:
Subject: Re: Memory-Bounded Hash Aggregation