pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mathieu De Zutter <mathieu@dezutter.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: Sorting a query on a view ignores an index
Date: Thu, 21 Aug 2003 18:24:48 +0200
Message-ID: <20030821162448.GC973@pleyel.kotnet.org> (raw)
In-Reply-To: <8509.1061477951@sss.pgh.pa.us>
References: <20030821133538.GA973@pleyel.kotnet.org>
	<8509.1061477951@sss.pgh.pa.us>

On Thu, Aug 21, 2003 at 10:59:11AM -0400, Tom Lane wrote:
> Mathieu De Zutter <mathieu@dezutter.org> writes:
> > However, i dont want the view to be presorted, but sort it in the
> > queries that use the view. When I do that, the index I have on that
> > field seems to be ignored. It stretches so far that, when I sort the
> > view on A and sort the query on A too, the query will try to sort
> > _again_ _without_ index and thus lose all performance.
> 
> This is a limitation of the 7.3 query planner.  7.4 should do better.

Ok I'll have to live with that I guess.
Apart from avoiding views or subselects when sorting afterwards and
putting the whole bunch in a huge SQL statement (which i'll have to
produce on-the-fly), do you have an other alternative? 
The 2 seconds is way to much, as the database will eventually run on a
machine that is 10 times slower.

With kind regards,

	Mathieu



view thread (7+ messages)  latest in thread

Message-ID: <20030821162448.GC973@pleyel.kotnet.org>
Permalink:  ../20030821162448.GC973@pleyel.kotnet.org/
Also on:    postgresql.org/message-id/20030821162448.GC973@pleyel.kotnet.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: mathieu@dezutter.org, tgl@sss.pgh.pa.us
  Subject: Re: Sorting a query on a view ignores an index
  In-Reply-To: <20030821162448.GC973@pleyel.kotnet.org>
  References: <20030821133538.GA973@pleyel.kotnet.org> <8509.1061477951@sss.pgh.pa.us> <20030821162448.GC973@pleyel.kotnet.org>

* 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