-
-
Notifications
You must be signed in to change notification settings - Fork 734
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
Add execution plan for Postgres #727
Comments
Postgres is really smart creating optimized execution plans. Postgres makes fair use of statistics. Thus I would take caution replacing all ? with null. This hit me once when I tried to "debug" a performance problem. I filled in nonsense-values on a test system and the execution plan was fine. Everything should have been blazing fast. |
I don't have much knowledge about how melody gets the queries, but if has it with the parameters, the strategy i think should work is: Sorry for bad english |
Since PostgreSQL 16 there is the option to request the generic execution plan. See this blog https://www.cybertec-postgresql.com/en/explain-generic-plan-postgresql-16/ and the official documentation. Please note that like the documentation states GENERIC_PLAN is not compatible with ANALYZE. Thus no real timings are available because PostgreSQL has no values to fill in to actually execute the query. Perhaps a case distinction is necessary to be able to evaluate queries without parameters with the duration of the queries and parameterised queries with a generic plan without a concrete duration. |
done for Postgresql 16 or later by #1223 and merged |
merged to 1.x branch also |
It would be great to have execution plan for Postgres like for Oracle.
It seems to me that the explain command needs to have values instead of binded parameters ('?'). But I suppose that we could replace all '?' by null before the explain command.
So how do we get the execution plan for Postgres given a jdbc connection?
The text was updated successfully, but these errors were encountered: