pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Віталій Тимчишин <tivv00@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: Planner not using column limit specified for one column for another column equal to first
Date: Sat, 17 Apr 2010 07:12:18 +0300
Message-ID: <n2o331e40661004162112u52e89c27i77dbade091133df4@mail.gmail.com> (raw)
In-Reply-To: <8534.1271427587@sss.pgh.pa.us>
References: <m2y331e40661004160102tff445f9eg165a04efe3b409ed@mail.gmail.com>
	<8534.1271427587@sss.pgh.pa.us>

16 квітня 2010 р. 17:19 Tom Lane <tgl@sss.pgh.pa.us> написав:

> =?KOI8-U?B?96bUwcymyiD0yc3eydvJzg==?= <tivv00@gmail.com> writes:
> > I've thought and someone in this list've told me that this should be done
> > automatically.
>
> As was pointed out, even if we had such logic it wouldn't apply in this
> example, because the equality conditions aren't real equalities but
> OUTER JOIN conditions.
>
>
In this case you can copy condition to "ON" condition, not to where cause
and this would work correct, e.g. "select something from a join b on a.x=b.y
where a.x > n" <=> "select something from a join b on a.x=b.y and b.y > n
where a.x > n".

As of making planner more clever, may be it is possible to introduce
division on "fast queries" and "long queries", so that if after fast
planning cost is greater then some configurable threshold, advanced planning
techniques (or settings) are used. As far as I have seen in this list, many
techniques are not used simply because they are too complex and could make
planning take too much time for really fast queries, but they are vital for
long ones.
Also same (or similar) threshold could be used to enable replanning for each
run of prepared query - also an often complaint is that planned query is not
that fast as is could be.

-- 
Best regards,
Vitalii Tymchyshyn

view thread (12+ messages)  latest in thread

Message-ID: <n2o331e40661004162112u52e89c27i77dbade091133df4@mail.gmail.com>
Permalink:  ../n2o331e40661004162112u52e89c27i77dbade091133df4@mail.gmail.com/
Also on:    postgresql.org/message-id/n2o331e40661004162112u52e89c27i77dbade091133df4@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-performance@postgresql.org
  Cc: tivv00@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: Planner not using column limit specified for one column for another column equal to first
  In-Reply-To: <n2o331e40661004162112u52e89c27i77dbade091133df4@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