Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Luca Ferrari <fluca1978@xxxxxxxxxxx> writes:
> 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?

Those two aren't correlated ... but I think what you want is

select ...,v,f
from
  pg_stats,
  rows from (unnest(most_common_vals::text::text[]),
             unnest(most_common_freqs)) r(v,f)
where ...

Seems to work back to 9.4.

			regards, tom lane




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux