Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server): log more stats per table, allow tables to be specified #5662

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

ThatOneBro
Copy link
Member

@ThatOneBro ThatOneBro commented Dec 12, 2024

This enables logging stats about the per-table autovacuum settings, as well as number of live and dead tuples in a table, when the last auto-vacuum and auto-analyzes ran, as well as the ability to specify which tables to include in the results.

@ThatOneBro ThatOneBro requested a review from a team as a code owner December 12, 2024 00:01
Copy link

vercel bot commented Dec 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medplum-provider ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2024 1:00am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
medplum-app ⬜️ Ignored (Inspect) Visit Preview Dec 12, 2024 1:00am
medplum-storybook ⬜️ Ignored (Inspect) Visit Preview Dec 12, 2024 1:00am
medplum-www ⬜️ Ignored (Inspect) Visit Preview Dec 12, 2024 1:00am

last_autoanalyze
FROM pg_stat_user_indexes i JOIN pg_class c ON i.relid = c.oid JOIN pg_stat_user_tables u ON i.relname = u.relname
${
params.tableNames
Copy link
Member

Choose a reason for hiding this comment

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

Can we move this to SQL params rather than string concatenation? I realize this is a super admin endpoint, so the risk is relatively low, but more of a good hygiene thing.

Or, at the very least, some basic string sanitization

Copy link
Member Author

Choose a reason for hiding this comment

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

FYI you can use WHERE <column> = ANY($1::text[]) to compare against parameterized arrays

@ThatOneBro ThatOneBro added this pull request to the merge queue Dec 12, 2024
Merged via the queue into main with commit 26ca772 Dec 12, 2024
33 checks passed
@ThatOneBro ThatOneBro deleted the derrick-add-more-db-stats-super-admin branch December 12, 2024 01:27
medplumbot added a commit that referenced this pull request Dec 14, 2024
## What's Changed

* docs(react-hooks): fix link description text (#5612)
* Preserve sort order for chained search using implicit joins (#5513)
* Use exponential backoff for bot deploy retries (#5618)
* Fsh (FHIR Shorthand) example (#5617)
* Fix markdown formatting on binary-data page (#5521)
* Helm & Terraform Deployment for Medplum app on GCP (#5390)
* Fixes #5616 - replace add/save buttons on search filter editor (#5620)
* Split config settings table into full sections (#5619)
* Add support for enableWhenExpression (#5624)
* Log verbose warning on database statement timeout (#5626)
* Do not fetch client info when client_id is medplum-cli (#5635)
* Disambiguate code column in $expand SQL (#5637)
* Client-side filtering in requestSchema to avoid loading  extra SDs (#5638)
* Address vscode vitest extension errors (#5639)
* Docs: Fixes invalid TS syntax for reverse chained search (#5628)
* Conditionally show DoseSpot icon in medplum-provider (#5623)
* feat(server): add super admin table settings route (#5633)
* Dependency upgrades 2024-12-09 (#5640)
* Support multi select (#5643)
* S3 Native Presigned URLs (#5445)
* Make AuditEventActionLookup exhaustive (#5652)
* Error in Heading caused sidebar issue migration-pipelines.md (#5650)
* Add defaultHeaders optional parameter for MedplumClient Constructor (#5653)
* Use transaction for If-Match check (#5647)
* Enhance audit logs with resource reference and interaction duration (#5649)
* feat(server): add logging for each seed step and duration (#5655)
* Add counter metric for FHIR interactions (#5656)
* docs: Add Multi-Tenant Access Control Implementation Guide (#5621)
* Fix metrics for interaction duration and count (#5659)
* feat(server): log more stats per table, allow tables to be specified (#5662)
* Fixes #5663 - add inner types to base-schema.json (#5665)
* Add sw operator to _filter search (#5666)
* Allow applying slice to singleton elements (#5661)
* Version policy doc (#5670)
* Remove note about _filter not supporting chained search (#5667)
* Questionnaire Builder preserve  whitespace in question (#5648)
* Added NDC constant (#5671)

**Full Changelog**: v3.2.24...v3.2.25
github-merge-queue bot pushed a commit that referenced this pull request Dec 14, 2024
## What's Changed

* docs(react-hooks): fix link description text (#5612)
* Preserve sort order for chained search using implicit joins (#5513)
* Use exponential backoff for bot deploy retries (#5618)
* Fsh (FHIR Shorthand) example (#5617)
* Fix markdown formatting on binary-data page (#5521)
* Helm & Terraform Deployment for Medplum app on GCP (#5390)
* Fixes #5616 - replace add/save buttons on search filter editor (#5620)
* Split config settings table into full sections (#5619)
* Add support for enableWhenExpression (#5624)
* Log verbose warning on database statement timeout (#5626)
* Do not fetch client info when client_id is medplum-cli (#5635)
* Disambiguate code column in $expand SQL (#5637)
* Client-side filtering in requestSchema to avoid loading  extra SDs (#5638)
* Address vscode vitest extension errors (#5639)
* Docs: Fixes invalid TS syntax for reverse chained search (#5628)
* Conditionally show DoseSpot icon in medplum-provider (#5623)
* feat(server): add super admin table settings route (#5633)
* Dependency upgrades 2024-12-09 (#5640)
* Support multi select (#5643)
* S3 Native Presigned URLs (#5445)
* Make AuditEventActionLookup exhaustive (#5652)
* Error in Heading caused sidebar issue migration-pipelines.md (#5650)
* Add defaultHeaders optional parameter for MedplumClient Constructor (#5653)
* Use transaction for If-Match check (#5647)
* Enhance audit logs with resource reference and interaction duration (#5649)
* feat(server): add logging for each seed step and duration (#5655)
* Add counter metric for FHIR interactions (#5656)
* docs: Add Multi-Tenant Access Control Implementation Guide (#5621)
* Fix metrics for interaction duration and count (#5659)
* feat(server): log more stats per table, allow tables to be specified (#5662)
* Fixes #5663 - add inner types to base-schema.json (#5665)
* Add sw operator to _filter search (#5666)
* Allow applying slice to singleton elements (#5661)
* Version policy doc (#5670)
* Remove note about _filter not supporting chained search (#5667)
* Questionnaire Builder preserve  whitespace in question (#5648)
* Added NDC constant (#5671)

**Full Changelog**: v3.2.24...v3.2.25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants