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

Run reindex / vacuum periodically to ensure queries perform well #114

Open
Tracked by #1641
1t5j0y opened this issue Nov 20, 2024 · 2 comments
Open
Tracked by #1641

Run reindex / vacuum periodically to ensure queries perform well #114

1t5j0y opened this issue Nov 20, 2024 · 2 comments
Assignees

Comments

@1t5j0y
Copy link
Contributor

1t5j0y commented Nov 20, 2024

In avniproject/avni-media#179, noticed a drastic improvement for base search queries from media app (queries media and address table) after executing

reindex (verbose) table goonj.address;
reindex (verbose) table goonj.media;
VACUUM (FULL, ANALYSE) goonj.address;

Analyse:

  1. Further analyse optimal frequency and if reindexing is required or vacuuming is sufficient.
  2. Special attention might be required on recreate ETL schema scenarios where there is heavy deletion and creation.

AC:

  1. Execute reindexing / vacuuming periodically on large ETL tables to ensure performance is good.

Solutioning:

SELECT schemaname, relname, last_autoanalyze, last_analyze FROM pg_stat_all_tables WHERE relname = 'address' and schemaname = 'goonj';
exposes when last analysis happened and can be used in the logic to determine whether vacuum analyse needs to be executed.

Out of scope:

  • Tables other than media viewer tables. We can see the impact and then do it on other tables as needed.
@github-project-automation github-project-automation bot moved this to New Issues in Avni Product Nov 20, 2024
@mahalakshme mahalakshme moved this from New Issues to Triaged in Avni Product Nov 20, 2024
@mahalakshme mahalakshme moved this from Triaged to In Analysis in Avni Product Nov 21, 2024
@mahalakshme mahalakshme moved this from In Analysis to In Analysis Review in Avni Product Nov 21, 2024
@mahalakshme mahalakshme moved this from In Analysis Review to Ready in Avni Product Nov 26, 2024
@1t5j0y 1t5j0y moved this from Ready to In Progress in Avni Product Dec 13, 2024
@1t5j0y 1t5j0y self-assigned this Dec 13, 2024
@1t5j0y 1t5j0y moved this from In Progress to In Analysis in Avni Product Dec 16, 2024
@mahalakshme
Copy link
Contributor

@1t5j0y Why is this in 'Analysis'? I think you told something, forgot.

@1t5j0y
Copy link
Contributor Author

1t5j0y commented Dec 23, 2024

@1t5j0y Why is this in 'Analysis'? I think you told something, forgot.

Observing performance pattern / deterioration before deciding on fix and deciding on what should trigger the vacuum. Shouldn't be blocker for 10.2 since we can run vacuum on demand in the meanwhile if required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Analysis
Development

No branches or pull requests

2 participants