Skip to content

Slowest query inspection #2

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

Closed
idlesign opened this issue Mar 13, 2020 · 2 comments · Fixed by #6
Closed

Slowest query inspection #2

idlesign opened this issue Mar 13, 2020 · 2 comments · Fixed by #6
Labels
help wanted Extra attention is needed

Comments

@idlesign
Copy link

idlesign commented Mar 13, 2020

Maybe add something like

SELECT (total_time / 1000 / 60) as total, (total_time / calls) as avg, query
FROM pg_stat_statements
ORDER BY 1 DESC
LIMIT 5;

to get stats on query perfomance. It's seems to be partly related to index health.

@mfvanek
Copy link
Owner

mfvanek commented Mar 16, 2020

pg_stat_statements is not a part of a standard PostgreSQL distribution. It's an extension without which given query will fail. That's why I don't want to add sql queries which rely on extensions.

I'll think about ext folder for such queries.

@mfvanek mfvanek added the help wanted Extra attention is needed label Mar 16, 2020
@idlesign
Copy link
Author

idlesign commented Mar 17, 2020

Yes, we can either separate those files or IF EXISTS in places where it's applicable.

@mfvanek mfvanek linked a pull request Apr 5, 2020 that will close this issue
@mfvanek mfvanek closed this as completed in #6 Apr 5, 2020
mfaulther pushed a commit to mfaulther/pg-index-health-sql that referenced this issue May 12, 2024
mfaulther pushed a commit to mfaulther/pg-index-health-sql that referenced this issue May 12, 2024
* Added support for schemes in raw queries

* Added PgContext

* DatabasePopulator refactoring

* Added schema name into DatabasePopulator

* Added tests for another schema

* Added support for another schema in IndexesHealth

* Tests fix mfvanek#1

* Tests fix mfvanek#2
mfaulther pushed a commit to mfaulther/pg-index-health-sql that referenced this issue May 12, 2024
* Upgraded postgres driver

* Added ColumnsWithJsonTypeCheckOnHost

* Added tests for ColumnsWithJsonTypeCheckOnHost

* Removed unnecessary tests

* Migrating to SharedDatabaseTestBase

* Migrating to SharedDatabaseTestBase mfvanek#2

* Removed PostgresExtensionFactory

* Fixed code smells

* Added javadoc

Co-authored-by: Ivan Vakhrushev <[email protected]>
mfaulther pushed a commit to mfaulther/pg-index-health-sql that referenced this issue May 12, 2024
* Update Gradle to 8.7

* Update dependencies

* Migrate to PMD 7 mfvanek#1

* Migrate to PMD 7 mfvanek#2
mfvanek added a commit that referenced this issue Jun 6, 2024
mfvanek added a commit that referenced this issue Jun 6, 2024
* Add ordering to the query

* More strict rules

* More strict rules #2
mfvanek added a commit that referenced this issue Dec 9, 2024
mfvanek added a commit that referenced this issue Dec 9, 2024
…62)

* Fix for primary_keys_with_serial_types.sql

* Fix linter warnings

* Fix linter warnings #2

* Fix error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants