Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c926999

Browse files
committed
reduce stat rereads
1 parent 3848a6c commit c926999

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

online_analyze.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,8 @@ makeAnalyze(Oid relOid, CmdKind operation, int64 naffected)
442442

443443
Assert(rstat->tableid == relOid);
444444

445+
elog(NOTICE,"makeAnalyze op:%d %u", operation, naffected);
446+
445447
if (operation != CK_TRUNCATE &&
446448
(found == false || rstat->rereadStat == true))
447449
{
@@ -466,9 +468,6 @@ makeAnalyze(Oid relOid, CmdKind operation, int64 naffected)
466468
}
467469
}
468470

469-
if (naffected == 0)
470-
rstat->rereadStat = true;
471-
472471
if (newTable ||
473472
/* force analyze from after truncate */
474473
operation == CK_TRUNCATE || (
@@ -555,6 +554,7 @@ makeAnalyze(Oid relOid, CmdKind operation, int64 naffected)
555554
{
556555
case CK_INSERT:
557556
rstat->n_tuples += naffected;
557+
rstat->rereadStat = false;
558558
break;
559559
case CK_UPDATE:
560560
rstat->n_tuples += naffected;
@@ -565,6 +565,7 @@ makeAnalyze(Oid relOid, CmdKind operation, int64 naffected)
565565
break;
566566
case CK_TRUNCATE:
567567
rstat->n_tuples = 0;
568+
rstat->rereadStat = false;
568569
break;
569570
default:
570571
break;

0 commit comments

Comments
 (0)