Skip to content

Commit d6baf4c

Browse files
committed
Merge branch 'REL9_5_STABLE' into PGPRO9_5
2 parents 1d13184 + 5b3cd1a commit d6baf4c

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

doc/src/sgml/ref/comment.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ COMMENT ON
135135
<term><replaceable class="parameter">domain_name</replaceable></term>
136136
<listitem>
137137
<para>
138-
When creating a comment on a constraint, a table, a domain or
138+
When creating a comment on a constraint, a trigger, a rule or
139139
a policy these parameters specify the name of the table or domain on
140-
which the constraint is defined.
140+
which that object is defined.
141141
</para>
142142
</listitem>
143143
</varlistentry>

src/backend/commands/analyze.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,10 +605,13 @@ do_analyze_rel(Relation onerel, int options, VacuumParams *params,
605605
/*
606606
* Report ANALYZE to the stats collector, too. However, if doing
607607
* inherited stats we shouldn't report, because the stats collector only
608-
* tracks per-table stats.
608+
* tracks per-table stats. Reset the changes_since_analyze counter only
609+
* if we analyzed all columns; otherwise, there is still work for
610+
* auto-analyze to do.
609611
*/
610612
if (!inh)
611-
pgstat_report_analyze(onerel, totalrows, totaldeadrows);
613+
pgstat_report_analyze(onerel, totalrows, totaldeadrows,
614+
(va_cols == NIL));
612615

613616
/* If this isn't part of VACUUM ANALYZE, let index AMs do cleanup */
614617
if (!(options & VACOPT_VACUUM))

src/backend/postmaster/pgstat.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,11 +1346,15 @@ pgstat_report_vacuum(Oid tableoid, bool shared,
13461346
* pgstat_report_analyze() -
13471347
*
13481348
* Tell the collector about the table we just analyzed.
1349+
*
1350+
* Caller must provide new live- and dead-tuples estimates, as well as a
1351+
* flag indicating whether to reset the changes_since_analyze counter.
13491352
* --------
13501353
*/
13511354
void
13521355
pgstat_report_analyze(Relation rel,
1353-
PgStat_Counter livetuples, PgStat_Counter deadtuples)
1356+
PgStat_Counter livetuples, PgStat_Counter deadtuples,
1357+
bool resetcounter)
13541358
{
13551359
PgStat_MsgAnalyze msg;
13561360

@@ -1387,6 +1391,7 @@ pgstat_report_analyze(Relation rel,
13871391
msg.m_databaseid = rel->rd_rel->relisshared ? InvalidOid : MyDatabaseId;
13881392
msg.m_tableoid = RelationGetRelid(rel);
13891393
msg.m_autovacuum = IsAutoVacuumWorkerProcess();
1394+
msg.m_resetcounter = resetcounter;
13901395
msg.m_analyzetime = GetCurrentTimestamp();
13911396
msg.m_live_tuples = livetuples;
13921397
msg.m_dead_tuples = deadtuples;
@@ -5110,10 +5115,12 @@ pgstat_recv_analyze(PgStat_MsgAnalyze *msg, int len)
51105115
tabentry->n_dead_tuples = msg->m_dead_tuples;
51115116

51125117
/*
5113-
* We reset changes_since_analyze to zero, forgetting any changes that
5114-
* occurred while the ANALYZE was in progress.
5118+
* If commanded, reset changes_since_analyze to zero. This forgets any
5119+
* changes that were committed while the ANALYZE was in progress, but we
5120+
* have no good way to estimate how many of those there were.
51155121
*/
5116-
tabentry->changes_since_analyze = 0;
5122+
if (msg->m_resetcounter)
5123+
tabentry->changes_since_analyze = 0;
51175124

51185125
if (msg->m_autovacuum)
51195126
{

src/include/pgstat.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ typedef struct PgStat_MsgAnalyze
382382
Oid m_databaseid;
383383
Oid m_tableoid;
384384
bool m_autovacuum;
385+
bool m_resetcounter;
385386
TimestampTz m_analyzetime;
386387
PgStat_Counter m_live_tuples;
387388
PgStat_Counter m_dead_tuples;
@@ -932,7 +933,8 @@ extern void pgstat_report_autovac(Oid dboid);
932933
extern void pgstat_report_vacuum(Oid tableoid, bool shared,
933934
PgStat_Counter livetuples, PgStat_Counter deadtuples);
934935
extern void pgstat_report_analyze(Relation rel,
935-
PgStat_Counter livetuples, PgStat_Counter deadtuples);
936+
PgStat_Counter livetuples, PgStat_Counter deadtuples,
937+
bool resetcounter);
936938

937939
extern void pgstat_report_recovery_conflict(int reason);
938940
extern void pgstat_report_deadlock(void);

src/nls-global.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ all-po: $(MO_FILES)
7676
ifeq ($(word 1,$(GETTEXT_FILES)),+)
7777
po/$(CATALOG_NAME).pot: $(word 2, $(GETTEXT_FILES)) $(MAKEFILE_LIST)
7878
ifdef XGETTEXT
79-
$(XGETTEXT) -D $(srcdir) -n $(addprefix -k, $(GETTEXT_TRIGGERS)) $(addprefix --flag=, $(GETTEXT_FLAGS)) -f $<
79+
$(XGETTEXT) -D $(srcdir) -D . -n $(addprefix -k, $(GETTEXT_TRIGGERS)) $(addprefix --flag=, $(GETTEXT_FLAGS)) -f $<
8080
else
8181
@echo "You don't have 'xgettext'."; exit 1
8282
endif
@@ -85,7 +85,7 @@ po/$(CATALOG_NAME).pot: $(GETTEXT_FILES) $(MAKEFILE_LIST)
8585
# Change to srcdir explicitly, don't rely on $^. That way we get
8686
# consistent #: file references in the po files.
8787
ifdef XGETTEXT
88-
$(XGETTEXT) -D $(srcdir) -n $(addprefix -k, $(GETTEXT_TRIGGERS)) $(addprefix --flag=, $(GETTEXT_FLAGS)) $(GETTEXT_FILES)
88+
$(XGETTEXT) -D $(srcdir) -D . -n $(addprefix -k, $(GETTEXT_TRIGGERS)) $(addprefix --flag=, $(GETTEXT_FLAGS)) $(GETTEXT_FILES)
8989
else
9090
@echo "You don't have 'xgettext'."; exit 1
9191
endif

0 commit comments

Comments
 (0)