Skip to content

Add mutate query to analyze unanalyzed tables#176

Merged
hexylena merged 1 commit into
galaxyproject:mainfrom
natefoo:mutate-analyze-unanalyzed
Mar 17, 2026
Merged

Add mutate query to analyze unanalyzed tables#176
hexylena merged 1 commit into
galaxyproject:mainfrom
natefoo:mutate-analyze-unanalyzed

Conversation

@natefoo

@natefoo natefoo commented Mar 16, 2026

Copy link
Copy Markdown
Member

We're interested in using n_live_tup for monitoring table growth, but this only works if the table has been analyzed since the last PostgreSQL start and is semi-regularly analyzed (for which gxadmin mutate scale-table-autovacuum is useful).

@natefoo natefoo force-pushed the mutate-analyze-unanalyzed branch from 17b9e89 to 4269c6f Compare March 16, 2026 20:16
Comment thread parts/21-mutate.sh
read -r -d '' qstr <<-EOF
SELECT relname FROM pg_stat_user_tables WHERE schemaname = 'public' AND last_autoanalyze IS NULL AND last_analyze IS NULL
EOF
mapfile -t results < <(query_tsv "$qstr")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

til!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks stackoverflow ;)

@hexylena hexylena merged commit f0e31a4 into galaxyproject:main Mar 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants