On Mon, Apr 20, 2026 at 3:00 PM Alexander Lakhin <exclusion@gmail.com> wrote:
>
> I think, I found another test which suffers from autoanalyze with the new
> behavior: [1], [2].
Thanks for continuing to look for these!
> Initially I reproduced this diff on a slow armv7 device after many
> iterations of `make check` with:
> autovacuum_naptime = 1
> autovacuum_analyze_threshold = 1
> debug_parallel_query = 'regress'
>
> But now I see that it can be reproduced on an ordinary machine with just:
> --- a/src/test/regress/sql/plancache.sql
> +++ b/src/test/regress/sql/plancache.sql
> @@ -208,2 +208,3 @@ execute test_mode_pp(1); -- 2x
> execute test_mode_pp(1); -- 3x
> +analyze test_mode;
> execute test_mode_pp(1); -- 4x
> (and expected/plancache.out updated)
>
> and `make check` running in a loop. It failed for me on iterations 5, 4,
> 10 (as far as I can see, analyze updates relallvisible not every time):
If you do vacuum test_mode instead, it should fail reliably.
I think we can avoid having relallvisible updated by doing two things:
1) moving the analyze test_mode above the create index because the
create index will scan the table and could set pages all-visible and
then the analyze may update the statistics
2) create the table with autovacuum_enabled = false to avoid vacuum
and analyze running after any of the other table scans may set some
pages all-visible
- Melanie