Re: PoC/WIP: Extended statistics on expressions

Tomas Vondra <tomas.vondra@enterprisedb.com>

From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Justin Pryzby <pryzby@telsasoft.com>, Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: pgsql-hackers@postgresql.org
Date: 2021-03-05T01:17:37Z
Lists: pgsql-hackers
On 3/5/21 1:43 AM, Justin Pryzby wrote:
> On Mon, Jan 04, 2021 at 09:45:24AM -0600, Justin Pryzby wrote:
>> On Mon, Jan 04, 2021 at 03:34:08PM +0000, Dean Rasheed wrote:
>>> * I'm not sure I understand the need for 0001. Wasn't there an earlier
>>> version of this patch that just did it by re-populating the type
>>> array, but which still had it as an array rather than turning it into
>>> a list? Making it a list falsifies some of the comments and
>>> function/variable name choices in that file.
>>
>> This part is from me.
>>
>> I can review the names if it's desired , but it'd be fine to fall back to the
>> earlier patch.  I thought a pglist was cleaner, but it's not needed.
> 
> This updates the preliminary patches to address the issues Dean raised.
> 
> One advantage of using a pglist is that we can free it by calling
> list_free_deep(Typ), rather than looping to free each of its elements.
> But maybe for bootstrap.c it doesn't matter, and we can just write:
> | Typ = NULL; /* Leak the old Typ array */
> 

Thanks. I'll switch this in the next version of the patch series.

regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Commits

  1. Disallow extended statistics on system columns

  2. Identify simple column references in extended statistics

  3. Don't print extra parens around expressions in extended stats

  4. Change position of field "transformed" in struct CreateStatsStmt.

  5. Add transformed flag to nodes/*funcs.c for CREATE STATISTICS

  6. Stabilize stats_ext test with other collations

  7. Extended statistics on expressions

  8. Reduce duration of stats_ext regression tests

  9. Allow composite types in catalog bootstrap

  10. Convert Typ from array to list in bootstrap

  11. Disallow CREATE STATISTICS on system catalogs