Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

参考sql server 更新统计信息算法,优化大表无法及时vacuum 文档 #537

Open
wants to merge 1 commit into
base: POLARDB_15_STABLE
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/backend/postmaster/autovacuum.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
#include "utils/syscache.h"
#include "utils/timeout.h"
#include "utils/timestamp.h"

#include <math.h>

/*
* GUC parameters
Expand Down Expand Up @@ -3128,9 +3128,9 @@ relation_needs_vacanalyze(Oid relid,
if (reltuples < 0)
reltuples = 0;

vacthresh = (float4) vac_base_thresh + vac_scale_factor * reltuples;
vacthresh = (float4) fmin(vac_base_thresh + vac_scale_factor * reltuples, vac_base_thresh + vac_scale_factor * sqrt(reltuples) * 1000.0 );
vacinsthresh = (float4) vac_ins_base_thresh + vac_ins_scale_factor * reltuples;
anlthresh = (float4) anl_base_thresh + anl_scale_factor * reltuples;
anlthresh = (float4) fmin(anl_base_thresh + anl_scale_factor * reltuples ,anl_base_thresh + anl_scale_factor * sqrt(reltuples) * 1000.0 );

/*
* Note that we don't need to take special consideration for stat
Expand Down
Loading