Re: [ADMIN] How to drop stats on table

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Sridhar N Bamandlapally <sridhar(dot)bn1(at)gmail(dot)com>, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: [ADMIN] How to drop stats on table
Date: 2015-11-21 15:17:25
Message-ID: 56508B05.9000008@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

On 11/20/2015 11:24 PM, Sridhar N Bamandlapally wrote:
> the actual issue is, when
>
> 1. temp table <say tmp1>is created with rows
> 2. stats/analyze on table (tmp1)
> 3. table dropped (tmp1)
>
> but in stats related catalog tables a blot is created

What is a blot?

>
> In this scenario, thousands of temp tables created per day, blots are
> increasing and stats related tables are growing to 10's of GB
>
> however, we schedule vacuum on catalog tables to control size
>
> the worry is, catalog tables also undergo MVCC concept
>
> I think when table is dropped, should have option to remove or reuse
> related blot-space on catalog tables

You will need to be more specific, which catalog tables are growing?

Also what Postgres version are you using?

I am not seeing the behavior you describe, when using 9.4:

production=> create temp table p1 as select plant1.* from plant1;
SELECT 4535

production=> analyze p1;
ANALYZE

production=> select relname, n_tup_ins from pg_stat_user_tables where
relname='p1';
relname | n_tup_ins
---------+-----------
p1 | 4535
(1 row)

production=> drop table p1;
DROP TABLE

production=> select relname, n_tup_ins from pg_stat_user_tables where
relname='p1';
relname | n_tup_ins
---------+-----------
(0 rows)

>
> -Sridhar
>
>
>
> On Fri, Nov 20, 2015 at 5:54 PM, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at
> <mailto:laurenz(dot)albe(at)wien(dot)gv(dot)at>> wrote:
>
> Sridhar N Bamandlapally wrote:
> > is there any feature available in postgres to drop stats on table?
>
> What about
>
> DELETE FROM pg_catalog.pg_statistic WHERE starelid = <table oid>
>
> Yours,
> Laurenz Albe
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Alexander Shereshevsky 2015-11-21 17:19:23 Re: [ADMIN] How to drop stats on table
Previous Message Sridhar N Bamandlapally 2015-11-21 07:24:53 Re: [ADMIN] How to drop stats on table

Browse pgsql-general by date

  From Date Subject
Next Message Alex Luya 2015-11-21 15:26:25 remote connection error:could not connect to server: Connection refused
Previous Message Sridhar N Bamandlapally 2015-11-21 07:24:53 Re: [ADMIN] How to drop stats on table