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

Measure Execution Time with postgresql_query and postgresql_script #787

Closed
optica-phoffmann opened this issue Jan 7, 2025 · 5 comments · Fixed by #792
Closed

Measure Execution Time with postgresql_query and postgresql_script #787

optica-phoffmann opened this issue Jan 7, 2025 · 5 comments · Fixed by #792
Assignees

Comments

@optica-phoffmann
Copy link

SUMMARY

I want to be able to get the execution time of an sql query. I searched the docs of postgresql_query and postgresql_script. I looks like this feature is currently not available. I searched the issues in this repo but couldn't find any discussion about this.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME
  • postgresql_query
  • postgresql_script
ADDITIONAL INFORMATION

Ansible Task Example:

- name: Simple select query to acme db
  community.postgresql.postgresql_query:
    db: acme
    query: SELECT id FROM accounts
    measure_time: yes

Additional Return value

execution_time_ms: 7104.652
@hunleyd
Copy link
Collaborator

hunleyd commented Jan 7, 2025

Thanks for the feature suggestion @optica-phoffmann ! Is this something you would want to tackle?

@Andersson007
Copy link
Collaborator

looking

@Andersson007
Copy link
Collaborator

@optica-phoffmann would something like #792 work for you?

@optica-phoffmann
Copy link
Author

@Andersson007 Wow, looks very nice to me. Thank you!

@Andersson007
Copy link
Collaborator

@optica-phoffmann thanks for the contribution by requesting the feature! @hunleyd thanks for the contribution by reviewing and merging the PR!
I think we could do the same for community.mysql and community.clickhouse collections as there are similar modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants