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

Commit63513b2

Browse files
committed
Fix thinko in previous patch to always update pg_class.reltuples/relpages.
I mis-simplified the test where ANALYZE decided if it could get awaywithout doing anything: under the new regime, that's never allowed. Perbug #6068 from Jeff Janes. Back-patch to 8.4, just like previous patch.
1 parent8a8fbe7 commit63513b2

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

‎src/backend/commands/analyze.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ do_analyze_rel(Relation onerel, VacuumStmt *vacstmt, bool inh)
266266
Relation*Irel;
267267
intnindexes;
268268
boolhasindex;
269-
boolanalyzableindex;
270269
VacAttrStats**vacattrstats;
271270
AnlIndexData*indexdata;
272271
inttargrows,
@@ -380,7 +379,6 @@ do_analyze_rel(Relation onerel, VacuumStmt *vacstmt, bool inh)
380379
}
381380
hasindex= (nindexes>0);
382381
indexdata=NULL;
383-
analyzableindex= false;
384382
if (hasindex)
385383
{
386384
indexdata= (AnlIndexData*)palloc0(nindexes*sizeof(AnlIndexData));
@@ -414,27 +412,19 @@ do_analyze_rel(Relation onerel, VacuumStmt *vacstmt, bool inh)
414412
thisdata->vacattrstats[tcnt]=
415413
examine_attribute(Irel[ind],i+1,indexkey);
416414
if (thisdata->vacattrstats[tcnt]!=NULL)
417-
{
418415
tcnt++;
419-
analyzableindex= true;
420-
}
421416
}
422417
}
423418
thisdata->attr_cnt=tcnt;
424419
}
425420
}
426421
}
427422

428-
/*
429-
* Quit if no analyzable columns.
430-
*/
431-
if (attr_cnt <=0&& !analyzableindex)
432-
gotocleanup;
433-
434423
/*
435424
* Determine how many rows we need to sample, using the worst case from
436425
* all analyzable columns.We use a lower bound of 100 rows to avoid
437-
* possible overflow in Vitter's algorithm.
426+
* possible overflow in Vitter's algorithm. (Note: that will also be
427+
* the target in the corner case where there are no analyzable columns.)
438428
*/
439429
targrows=100;
440430
for (i=0;i<attr_cnt;i++)
@@ -573,9 +563,6 @@ do_analyze_rel(Relation onerel, VacuumStmt *vacstmt, bool inh)
573563
if (!inh)
574564
pgstat_report_analyze(onerel,totalrows,totaldeadrows);
575565

576-
/* We skip to here if there were no analyzable columns */
577-
cleanup:
578-
579566
/* If this isn't part of VACUUM ANALYZE, let index AMs do cleanup */
580567
if (!(vacstmt->options&VACOPT_VACUUM))
581568
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp