Re: Thinking about ANALYZE stats and autovacuum and large non-uniform tables - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Thinking about ANALYZE stats and autovacuum and large non-uniform tables
Date
Msg-id CA+hUKGJFA2Dtzn_Er7R27FM2ijewHZMJ_mmS_fiLhgrWwxF8sA@mail.gmail.com
Whole thread Raw
In response to Thinking about ANALYZE stats and autovacuum and large non-uniform tables  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
On Fri, Oct 22, 2021 at 10:13 AM Greg Stark <stark@mit.edu> wrote:
> Obviously this could get complex quickly. Perhaps it should be
> something users could declare. Some kind of "partitioned statistics"
> where you declare a where clause and we generate statistics for the
> table where that where clause is true. Then we could fairly easily
> also count things like n_mod_since_analyze for that where clause too.

It's a different thing, but somehow related and maybe worth
mentioning, that in DB2 you can declare a table to be VOLATILE.  In
that case, by some unspecified different heuristics, it'll prefer
index scans over table scans, and it's intended to give stable
performance for queue-like tables by defending against automatically
scheduled stats being collected at a bad time.  It's been a while
since I ran busy queue-like workloads on DB2 but I seem to recall it
was more about the dangers of tables that sometimes have say 10 rows
and something 42 million, rather than the case of 42 million DONE rows
and 0-10 PENDING rows, but not a million miles off.



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Thinking about ANALYZE stats and autovacuum and large non-uniform tables
Next
From: Zhihong Yu
Date:
Subject: Re: Partial aggregates pushdown