Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9ca99cd

Browse files
committed
Update relpages and reltuples estimates in stand-alone ANALYZE, even if
there's no analyzable attributes or indexes. We also used to report 0 liveand dead tuples for such tables, which messed with autovacuum thresholdcalculations.This fixes bug #4812 reported by George Su. Backpatch back to 8.1.
1 parent7280fab commit9ca99cd

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

‎src/backend/commands/analyze.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.136 2009/05/05 18:02:11 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.137 2009/05/19 08:30:00 heikki Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -363,19 +363,10 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt,
363363
}
364364

365365
/*
366-
* Quit if no analyzable columns
366+
* Quit if no analyzable columns and no pg_class update needed.
367367
*/
368-
if (attr_cnt <=0&& !analyzableindex)
369-
{
370-
/*
371-
* We report that the table is empty; this is just so that the
372-
* autovacuum code doesn't go nuts trying to get stats about a
373-
* zero-column table.
374-
*/
375-
if (update_reltuples)
376-
pgstat_report_analyze(onerel,0,0);
368+
if (attr_cnt <=0&& !analyzableindex&& !update_reltuples)
377369
gotocleanup;
378-
}
379370

380371
/*
381372
* Determine how many rows we need to sample, using the worst case from

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp