Search Postgresql Archives

Re: How to delete column level Stats/Histogram

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

 



On Fri, 31 May 2024 at 09:28, Wong, Kam Fook (TR Technology)
<kamfook.wong@xxxxxxxxxxxxxxxxxx> wrote:
> Is there a way to delete a specific column level stats/histogram.  The following approach does not work.
>
> alter table abc alter column bg_org_partner set statistics 0;
> analyze   abc;

You'd have to:

DELETE FROM pg_statistic WHERE starelid = 'abc'::regclass and
staattnum = (SELECT attnum FROM pg_attribute WHERE attrelid =
'abc'::regclass AND attname = 'bg_org_partner');

to get rid of it.

David





[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 Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux