Re: unnest-like pg_stats.most_common_values and pg_stats.most_common_freqs

From: Luca Ferrari <fluca1978(at)infinito(dot)it>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: unnest-like pg_stats.most_common_values and pg_stats.most_common_freqs
Date: 2017-11-20 08:05:03
Message-ID: CAKoxK+6BN7BSVKg-aZdFmEMutP+QbyuwN4pftS89ohB-zHTyRw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Nov 17, 2017 at 9:41 PM, Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:
> I think you want something like this ?
>
> postgres=# SELECT schemaname, tablename, attname, unnest(histogram_bounds::text::text[]), histogram_bounds FROM pg_stats LIMIT 9;
> pg_catalog | pg_pltemplate | tmplname | plperl | {plperl,plperlu,plpgsql,plpython2u,plpython3u,plpythonu,pltcl,pltclu}

I don't think it is what I'm looking for, I would like something ,like:

select unnest( histogram_bounds::text::text[] ), unnest(
most_common_freqs ) from pg_stats

but with correlation between the two array indexes. Is it something
achievable in SQL? Or should I use a plpgsql loop with an index?

Luca

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Semler Miloslav 2017-11-20 08:12:04 Re: Query Using Massive Temp Space
Previous Message Laurenz Albe 2017-11-20 07:08:12 Re: Query Using Massive Temp Space