pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: olivier boissard <olivier.boissard@cerene.fr>
Cc: pgsql-admin@postgresql.org
Subject: Re: How to uses self query plan
Date: Wed, 19 Dec 2007 09:33:06 -0600
Message-ID: <dcc563d10712190733n12af01f6tc9ef225e278a04ed@mail.gmail.com> (raw)
In-Reply-To: <4768CEEF.9060506@cerene.fr>
References: <476847DB.9090401@cerene.fr>
	<dcc563d10712181446t2bc5dc0ftaaf0f6798be7f08c@mail.gmail.com>
	<4768CEEF.9060506@cerene.fr>

On Dec 19, 2007 1:57 AM, olivier boissard <olivier.boissard@cerene.fr> wrote:
> Scott Marlowe a écrit :
>
> > On Dec 18, 2007 4:21 PM, olivier.boissard@cerene.fr
> > <olivier.boissard@cerene.fr> wrote:
> >
> >> Hello,
> >>
> >> My purpose is to uses different query plan depending on queries
> >> I got the following problem : some queries are taking too much time and
> >> postgresql does not take the most relevant index in account.
> >> I search on internet and found that no HINT function was available in
> >> postgresl.
> >> I tried to change indexes parameters in postgresql.conf but eache time I
> >> set a param to OFF (example nested_loop ,seqscan, ...) , some queries
> >> freeze database .
> >>
> >> How can we force postgresql to use a plan ?
> >>
> >
> > That's not how we do things in postgresql land (usually).
> >
> > You should figure out WHY your queries are picking the wrong plan, and
> > then see if you can get them to pick the right ones.  If it's a query
> > planner bug, you report it here, or the perform or general lists, and
> > it gets fixed.  Generic hints aren't likely to happen any time soon,
> > although I do believe 8.3 is introducing function costing of some
> > kind, which seems like a useful idea.
> >
> > But, back to fixing your slow queries.
> >
> > 1: Increase statistics targets on the guilty columns and reanalyze.
> > 2: Run explain analyze select.... and post the output here.
> > 3: ???
> > 4: profit?
> >
> Thanks for reply
>
> I will extract some queries.
> I want to precise that I use postgresql 8.1.0 .

First step would be to update to the latest 8.1.x version, whatever
that is.  There have been a LOT of fixes in the 8.1 branch since 8.1.0
came out, and one might be a fix for your query problem.  minor
updates are strictly bug and security fixes, so they're not likely to
cause any problems.



view thread (9+ messages)  latest in thread

Message-ID: <dcc563d10712190733n12af01f6tc9ef225e278a04ed@mail.gmail.com>
Permalink:  ../dcc563d10712190733n12af01f6tc9ef225e278a04ed@mail.gmail.com/
Also on:    postgresql.org/message-id/dcc563d10712190733n12af01f6tc9ef225e278a04ed@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: scott.marlowe@gmail.com, olivier.boissard@cerene.fr
  Subject: Re: How to uses self query plan
  In-Reply-To: <dcc563d10712190733n12af01f6tc9ef225e278a04ed@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox