Re: Statistics Import and Export - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: Statistics Import and Export
Date
Msg-id CADkLM=fZWAPyDxmHqxiJMUvrjbi2Fo1pHr+63_1d8yhStZ=sXQ@mail.gmail.com
Whole thread Raw
In response to Re: Statistics Import and Export  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Statistics Import and Export
List pgsql-hackers
To my mind the next task is to get the buildfarm green again by
fixing the expression-index-stats problem.  I can have a go at
that once Jeff pushes these patches, unless one of you are already
on it?

Already on it, but I can step aside if you've got a clearer vision of how to solve it.

My solution so far is to take allo the v11+ (SELECT array_agg...) functions and put them into a LATERAL, two of them filtered by attstattarget > 0 and a new one aggregating attnames with no filter.

An alternative would be a new subselect for array_agg(attname) WHERE in.indexprs IS NOT NULL, thus removing the extra compute for the indexes that lack an index expression (i.e. most of them), and thus lack settable stats (at least for now) and wouldn't be affected by the name-jitter issue anyway.

I'm on the fence about how to handle pg_clear_attribute_stats(), leaning toward overloaded functions.


pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Statistics Import and Export
Next
From: Andrey Borodin
Date:
Subject: Re: Spinlock can be released twice in procsignal.c