This is a discussion on simple explain output. within the Pgsql General forums, part of the PostgreSQL category; --> Hi all, I'm pretty sure the answer to this is "not possible" but I'll ask just in case. Is ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi all, I'm pretty sure the answer to this is "not possible" but I'll ask just in case. Is there a way to simplify the output that comes from explain? I'm writing a script to check my database logs to see whether I am missing any indexes. Basically the process goes like this: - Find a select query in the logs - Run it through the database using 'explain' - Check whether it's using an index scan or "other" Yes, I know not every query is going to use an index, but this will cut down on the queries I have to check. At the moment the explain output can get complicated to parse and process, so I'm trying to think of another approach to use. Any suggestions are welcome Chris. ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| ||||
| Chris writes: > At the moment the explain output can get complicated to parse and > process, so I'm trying to think of another approach to use. > > Any suggestions are welcome I think the solution is using debug_print_plan (a guc variable). You can use it to get machine-readable plans in the logs and/or via a client connection depending on the client_min_messages and log_min_messages setting. regards, Andreas -- ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |