optimize the value of vacthresh and anlthresh
Thread notes
1 note#performance#minor#enhancement
hackorum-bot#performance#minor#enhancement
@global #performance #minor #enhancement
Hi hackers
A few days ago, I was looking at the sql server documentation and found
that sql server has optimized the algorithm related to updating statistics
in the 2016 ,version,I think we can also learn from the implementation
method of sql server to optimize the problem of automatic vacuum triggered
by large tables,The Document link(
https://learn.microsoft.com/en-us/sql/relational-databases/statistics/statistics?view=sql-server-ver16),I
refer to the sql server implementation method, submit a patch, please see
the attachment, hope to get the help of expert hackers
Attachments:
0001-optimize-the-value-of-vacthresh-and-anlthresh.patchapplication/octet-stream; name=0001-optimize-the-value-of-vacthresh-and-anlthresh.patchDownload+8-4
Hi hackers
I find that the arithmetic square root is not very smooth, and the
logarithmic function is smoother,Looking at the graph, the log function
algorithm might be more appropriate,I want to hear from the experts
sqrt
[image: image.png]
log2
[image: image.png]
log
[image: image.png]
orginal
[image: image.png]
postgres=# select ln(100000)*1000;
?column?
--------------------
11512.925464970229
(1 row)
postgres=# select log(2,100000)*1000;
?column?
-----------------------
16609.640474436812000
(1 row)
postgres=#
postgres=# select log(10,100000)*1000;
?column?
----------------------
5000.000000000000000
(1 row)
wenhui qiu <qiuwenhuifx@gmail.com> 于2024年11月4日周一 16:30写道:
Show quoted text
Hi hackers
A few days ago, I was looking at the sql server documentation and
found that sql server has optimized the algorithm related to updating
statistics in the 2016 ,version,I think we can also learn from the
implementation method of sql server to optimize the problem of automatic
vacuum triggered by large tables,The Document link(
https://learn.microsoft.com/en-us/sql/relational-databases/statistics/statistics?view=sql-server-ver16),I
refer to the sql server implementation method, submit a patch, please see
the attachment, hope to get the help of expert hackers
Hi hackers
Here new path , I think it is most appropriate to use a logarithmic
function with base 2
Thanks
wenhui qiu <qiuwenhuifx@gmail.com> 于2024年11月6日周三 11:44写道:
Show quoted text
Hi hackers
I find that the arithmetic square root is not very smooth, and the
logarithmic function is smoother,Looking at the graph, the log function
algorithm might be more appropriate,I want to hear from the expertssqrt
[image: image.png]
log2[image: image.png]
log
[image: image.png]
orginal
[image: image.png]
postgres=# select ln(100000)*1000;
?column?
--------------------
11512.925464970229
(1 row)postgres=# select log(2,100000)*1000;
?column?
-----------------------
16609.640474436812000
(1 row)postgres=#
postgres=# select log(10,100000)*1000;
?column?
----------------------
5000.000000000000000
(1 row)wenhui qiu <qiuwenhuifx@gmail.com> 于2024年11月4日周一 16:30写道:
Hi hackers
A few days ago, I was looking at the sql server documentation and
found that sql server has optimized the algorithm related to updating
statistics in the 2016 ,version,I think we can also learn from the
implementation method of sql server to optimize the problem of automatic
vacuum triggered by large tables,The Document link(
https://learn.microsoft.com/en-us/sql/relational-databases/statistics/statistics?view=sql-server-ver16),I
refer to the sql server implementation method, submit a patch, please see
the attachment, hope to get the help of expert hackers
Attachments:
t50502_3image.pngimage/png; name=image.pngDownload
image.pngimage/png; name=image.pngDownload+0-3
image.pngimage/png; name=image.pngDownload+2-1
image.pngimage/png; name=image.pngDownload+2-6
0002-optimize-the-value-of-vacthresh-and-anlthresh.patchapplication/octet-stream; name=0002-optimize-the-value-of-vacthresh-and-anlthresh.patchDownload+3-4
On 11/4/24 09:30, wenhui qiu wrote:
Hi hackers
A few days ago, I was looking at the sql server documentation and
found that sql server has optimized the algorithm related to updating
statistics in the 2016 ,version,I think we can also learn from the
implementation method of sql server to optimize the problem of automatic
vacuum triggered by large tables,The Document
link(https://learn.microsoft.com/en-us/sql/relational-databases/statistics/statistics?view=sql-server-ver16 <https://learn.microsoft.com/en-us/sql/relational-databases/statistics/statistics?view=sql-server-ver16>),I refer to the sql server implementation method, submit a patch, please see the attachment, hope to get the help of expert hackers
similar idea here :
/messages/by-id/6a2ac9b7-6535-4bb1-8274-0647f7c31c82@dalibo.com
Hi Frédéric
many thanks for your email。
I'll go and see.
On Wed, 6 Nov 2024 at 17:47, Frédéric Yhuel <frederic.yhuel@dalibo.com>
wrote:
Show quoted text
On 11/4/24 09:30, wenhui qiu wrote:
Hi hackers
A few days ago, I was looking at the sql server documentation and
found that sql server has optimized the algorithm related to updating
statistics in the 2016 ,version,I think we can also learn from the
implementation method of sql server to optimize the problem of automatic
vacuum triggered by large tables,The Document
link(https://learn.microsoft.com/en-us/sql/relational-databases/statistics/statistics?view=sql-server-ver16
<
https://learn.microsoft.com/en-us/sql/relational-databases/statistics/statistics?view=sql-server-ver16>),I
refer to the sql server implementation method, submit a patch, please see
the attachment, hope to get the help of expert hackerssimilar idea here :
/messages/by-id/6a2ac9b7-6535-4bb1-8274-0647f7c31c82@dalibo.com