Auto Vacuum optimisation

Started by wenhui qiuabout 2 years ago6 messageshackers

Thread notes

1 note#feature#moderate#enhancement
hackorum-bot#feature#moderate#enhancement
hackorum-bot
1 day ago

@global #feature #moderate #enhancement

#feature#moderate#enhancement
Jump to latest
#1wenhui qiu
qiuwenhuifx@gmail.com

HI hackers and japin li
There was an earlier discussion about auto vacuum optimisation(
/messages/by-id/6a2ac9b7-6535-4bb1-8274-0647f7c31c82@dalibo.com),I
referring to the discussion in there, I implemented a parameter selection
triggering the calculation of AUTO VACUUM,This is my first patch for the
community.Hoping for support from the experts

Attachments:

0001-Add-guc-to-optimize-the-autovacuum-tigger-algorithm.patchapplication/octet-stream; name=0001-Add-guc-to-optimize-the-autovacuum-tigger-algorithm.patchDownload+57-9
#2wenhui qiu
qiuwenhuifx@gmail.com
In reply to: wenhui qiu (#1)
Re: Auto Vacuum optimisation

HI hackers
These are algorithmic mathematical graphs,By default, vacuum will not be
triggered frequently.Looking at the images the algorithms for pow and sqrt
are close, do we want to cancel one of the algorithms?

log2
[image: image.png]

sqrt
[image: image.png]
pow
[image: image.png]

wenhui qiu <qiuwenhuifx@gmail.com> 于2024年11月18日周一 18:00写道:

Show quoted text

HI hackers and japin li
There was an earlier discussion about auto vacuum optimisation(

/messages/by-id/6a2ac9b7-6535-4bb1-8274-0647f7c31c82@dalibo.com),I
referring to the discussion in there, I implemented a parameter selection
triggering the calculation of AUTO VACUUM,This is my first patch for the
community.Hoping for support from the experts

Attachments:

image.pngimage/png; name=image.pngDownload+1-3
image.pngimage/png; name=image.pngDownload+1-4
image.pngimage/png; name=image.pngDownload+3-3
#3Japin Li
japinli@hotmail.com
In reply to: wenhui qiu (#2)
Re: Auto Vacuum optimisation

On Mon, 18 Nov 2024 at 18:20, wenhui qiu <qiuwenhuifx@gmail.com> wrote:

HI hackers
These are algorithmic mathematical graphs,By default, vacuum will not be triggered frequently.Looking at the images
the algorithms for pow and sqrt are close, do we want to cancel one of the algorithms?

log2
image.png

sqrt
image.png
pow
image.png

Sorry for the late reply.

Did you forget to upload the pictures?

There was an earlier discussion about auto vacuum optimisation(
/messages/by-id/6a2ac9b7-6535-4bb1-8274-0647f7c31c82@dalibo.com),I referring to the
discussion in there, I implemented a parameter selection triggering the calculation of AUTO VACUUM,This is my first
patch for the community.Hoping for support from the experts

I think this is helpful.

One of our customers had large tables that were frequently updated, and their
global configuration did not permit timely VACUUM operations on those tables.
As a result, they had to adjust the vacuum settings for those specific tables,
which unintentionally increased their maintenance burden.

However, I'm not sure we need so many autovacuum algorithms here since it makes
the choice harder (maybe).

--
Regrads,
Japin Li

#4wenhui qiu
qiuwenhuifx@gmail.com
In reply to: Japin Li (#3)
Re: Auto Vacuum optimisation

HI Japin Li
Thank you for you reply, Do you think that removing the log2 algorithm
because it will be more frequent,I think sql server chose sqrt algorithm
after their long-term verification, I think we need to retain sqrt
algorithm,The relevant documents are here(
https://learn.microsoft.com/en-us/sql/relational-databases/statistics/statistics?view=sql-server-ver16),I
will provide a new patch later with your reply

Thanks

Japin Li <japinli@hotmail.com> 于2024年11月26日周二 21:26写道:

Show quoted text

On Mon, 18 Nov 2024 at 18:20, wenhui qiu <qiuwenhuifx@gmail.com> wrote:

HI hackers
These are algorithmic mathematical graphs,By default, vacuum will not

be triggered frequently.Looking at the images

the algorithms for pow and sqrt are close, do we want to cancel one of

the algorithms?

log2
image.png

sqrt
image.png
pow
image.png

Sorry for the late reply.

Did you forget to upload the pictures?

There was an earlier discussion about auto vacuum optimisation(

/messages/by-id/6a2ac9b7-6535-4bb1-8274-0647f7c31c82@dalibo.com),I
referring to the

discussion in there, I implemented a parameter selection triggering the

calculation of AUTO VACUUM,This is my first

patch for the community.Hoping for support from the experts

I think this is helpful.

One of our customers had large tables that were frequently updated, and
their
global configuration did not permit timely VACUUM operations on those
tables.
As a result, they had to adjust the vacuum settings for those specific
tables,
which unintentionally increased their maintenance burden.

However, I'm not sure we need so many autovacuum algorithms here since it
makes
the choice harder (maybe).

--
Regrads,
Japin Li

Attachments:

linear.jpgimage/jpeg; name=linear.jpgDownload+15-6
log2.jpgimage/jpeg; name=log2.jpgDownload+1-2
power.jpgimage/jpeg; name=power.jpgDownload+1-5
sqrt.jpgimage/jpeg; name=sqrt.jpgDownload+0-2
#5Japin Li
japinli@hotmail.com
In reply to: wenhui qiu (#4)
Re: Auto Vacuum optimisation

On Wed, 27 Nov 2024 at 15:51, wenhui qiu <qiuwenhuifx@gmail.com> wrote:

HI Japin Li
Thank you for you reply, Do you think that removing the log2 algorithm because it will be more frequent,I think sql
server chose sqrt algorithm after their long-term verification, I think we need to retain sqrt algorithm,The relevant
documents are here(
https://learn.microsoft.com/en-us/sql/relational-databases/statistics/statistics?view=sql-server-ver16),I will provide a
new patch later with your reply

Worth a try.

However, I don't think we need to based on {vac,anl}_scale_factor when using
the sqrt algorithm.

--
Regrads,
Japin Li

#6wenhui qiu
qiuwenhuifx@gmail.com
In reply to: Japin Li (#5)
Re: Auto Vacuum optimisation

Hi Japin

Worth a try.
However, I don't think we need to based on {vac,anl}_scale_factor when

using

the sqrt algorithm.

Here a new path, I removed the log2 algorithm and the debug2 log and the
enumeration type is also kept consistent, based on {vac,anl}_scale_factor
when using the sqrt algorithm ,The main purpose is also to give DBAs the
flexibility to make small adjustments,Mainly referencing another discussion
as well, trying to stay in line with them

On Thu, Nov 28, 2024 at 1:46 PM Japin Li <japinli@hotmail.com> wrote:

Show quoted text

On Wed, 27 Nov 2024 at 15:51, wenhui qiu <qiuwenhuifx@gmail.com> wrote:

HI Japin Li
Thank you for you reply, Do you think that removing the log2

algorithm because it will be more frequent,I think sql

server chose sqrt algorithm after their long-term verification, I think

we need to retain sqrt algorithm,The relevant

documents are here(

https://learn.microsoft.com/en-us/sql/relational-databases/statistics/statistics?view=sql-server-ver16),I
will provide a

new patch later with your reply

Worth a try.

However, I don't think we need to based on {vac,anl}_scale_factor when
using
the sqrt algorithm.

--
Regrads,
Japin Li

Attachments:

t50585_6
0002-Add-guc-to-optimize-the-autovacuum-tigger-algorithm.patchapplication/octet-stream; name=0002-Add-guc-to-optimize-the-autovacuum-tigger-algorithm.patchDownload+47-5