From: | Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> |
---|---|
To: | jaya kumar <kumardba27(at)gmail(dot)com> |
Cc: | pgsql-admin(at)lists(dot)postgresql(dot)org |
Subject: | Re: Autovacuum------Doubts |
Date: | 2024-04-08 14:38:08 |
Message-ID: | 42e852495e19c1de2e734a666ae30d9b3e37abe1.camel@cybertec.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
On Mon, 2024-04-08 at 16:25 +0530, jaya kumar wrote:
> I am not clear.
I can confirm that.
> Could you explain again. If I delete 20 records out of 100. It means Autocacumm should run
> but not run automatically. As you provide a solution, the method should be deleted but does not happen.
If you delete 20 rows, autovacuum should not run.
> Delete record=30
>
> autovacuum_vacuum_threshold + autovacuum_vacuum_scale_factor * number of table rows ?
> o/p: 20+0.1*100=2010?
I don't know what an o/p is, but that calculation is wrong.
> DatabaseName=# show autovacuum_vacuum_threshold;
> autovacuum_vacuum_threshold
> -----------------------------
> 20
> (1 row)
>
> DatabaseName=# show autovacuum_vacuum_scale_factor;
> autovacuum_vacuum_scale_factor
> --------------------------------
> 0.1
> (1 row)
>
> DatabaseName=# select count(*) from emp9;
> count
> -------
> 100
> (1 row)
>
> DatabaseName=# delete from emp9 where eno between 1 and 30;
Try deleting 31 or 32 rows.
Statistics are not necessarily 100% accurate.
> On Mon, Apr 8, 2024 at 3:15 PM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> wrote:
> > On Mon, 2024-04-08 at 14:57 +0530, jaya kumar wrote:
> > > autovacuum_analyze_threshold and autovacuum_vacuum_threshold both parameter
> > > values set from 50 to 20.
> > >
> > > Created one table with 100 records. First, we deleted 21 records. after an
> > > autovacuum does not happen automatically. After again I deleted another 20.
> > > Out of 100 we delectated 40 records then the autovacuum happened automatically.
> > > As per the configuration Autocacuum will automatically delete 21 records
> > > in the table but my case does not happen.
> > >
> > > Can someone check and explain this.
> >
> > The threshold is
> >
> > autovacuum_vacuum_threshold + autovacuum_vacuum_scale_factor * number of table rows
> >
> > So since you have set autovacuum_vacuum_scale_factor to 0.1 and there are 100 rows,
> > you need to delete 20 + 100 * 0.1 = 30 rows before autovacuum kicks in.
Please bottom-post.
Yours,
Laurenz Albe
From | Date | Subject | |
---|---|---|---|
Next Message | Murthy Nunna | 2024-04-08 15:17:45 | Output shell variable from psql |
Previous Message | Ibrahim Shaame | 2024-04-08 14:02:30 | Can't install pgadmin4 - 8.5 from sources |