Is there any (preferably open source) software than can analyze a PostgreSQL EXPLAIN, and recommend the necessary indices that would speed up the query?
|
feedback
|
|
I literally just found this a couple of minutes ago: http://explain.depesz.com/. You paste in the results of your EXPLAIN ANALYZE and it shows you where there may be problems (it's even color coded). From the help section...
| |||
|
feedback
|
|
I'm not aware of any tool for Postgres that does this algorithmically, and in my opinion the human brain (and often a bit of experimentation in a dev environment) is really the only appropriate tool here. There are a lot of factors involved, including whether or not the query planner will even think your index is worth using -- something which is determined by the way your installation has tuned the query planner settings and the size/statistics on the involved table(s). The best recommendation I can make is to do an | |||
|
feedback
|
|
Nothing production grade, but for the curious, there is/was a research project to implement something like that. Search for "PostgreSQL index advisor". | |||
|
feedback
|