Re: Optional skipping of unchanged relations during ANALYZE? - Mailing list pgsql-hackers

From Ilia Evdokimov
Subject Re: Optional skipping of unchanged relations during ANALYZE?
Date
Msg-id c84ac92f-cf37-4398-a0f3-719274cb8c90@tantorlabs.com
Whole thread Raw
In response to Re: Optional skipping of unchanged relations during ANALYZE?  (Sami Imseih <samimseih@gmail.com>)
Responses Re: Optional skipping of unchanged relations during ANALYZE?
List pgsql-hackers


On 2/19/26 21:23, Sami Imseih wrote:
3/

+                       elog(DEBUG1,
+                               "ANALYZE (MISSING_STATS_ONLY):
skipping relation \"%s\"",
+                               RelationGetRelationName(onerel));

I think logging should be at info level, and we should only log when
skipping a relation


Also, I think it's better to use ereport like is being done for the other
ANALYZE logging, i.e.

```                        appendStringInfo(&buf,                                                         _("WAL usage:
%" PRId64 " records, %" PRId64 " full page images, %" PRIu64 " bytes,
%" PRIu64 " full page image bytes, %" PRId64 " buffers full\n"),                                                         walusage.wal_records,                                                         walusage.wal_fpi,                                                         walusage.wal_bytes,                                                         walusage.wal_fpi_bytes,

walusage.wal_buffers_full);                        appendStringInfo(&buf, _("system usage: %s"),
pg_rusage_show(&ru0));
                        ereport(verbose ? INFO : LOG,                                        (errmsg_internal("%s", buf.data)));
```

+1

I agree that in VERBOSE mode we should display a message when the relation is skipped. I suggest something along the lines of:

INFO:    Skipping analyzing "database.namespace.relation"

This would be consistent with the style already used in do_analyze_rel(). Since this is executed ANALYZE, and no statistics are actually collected , I don't think we need to display any additional details beyond this single line.

--
Best regards.
Ilia Evdokimov,
Tantor Labs LLC,
https://tantorlabs.com/

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Patch for migration of the pg_commit_ts directory
Next
From: Daniel Gustafsson
Date:
Subject: Re: ecdh support causes unnecessary roundtrips