Unix Technical Forum

simple explain output.

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 ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 09:27 AM
Chris
 
Posts: n/a
Default simple explain output.

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 09:27 AM
Andreas Seltenreich
 
Posts: n/a
Default Re: simple explain output.

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:52 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com