pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michiel Meeuwissen <Michiel.Meeuwissen@omroep.nl>
To: Rod Taylor <pg@rbt.ca>
Cc: performance@postgresql.org
Subject: Re: order by index, and inheritance
Date: Thu, 22 Apr 2004 13:02:14 +0200
Message-ID: <20040422110214.GH6870@michiel.omroep.nl> (raw)
In-Reply-To: <1082461767.57436.93.camel@jester>
References: <20040419113013.GA32186@michiel.omroep.nl>
	<1082455997.57436.10.camel@jester>
	<20040420104518.GF1618@michiel.omroep.nl>
	<1082461767.57436.93.camel@jester>

Rod Taylor <pg@rbt.ca> wrote:
> The scan is picking the best method for grabbing everything within the
> table, since it is not aware that we do not require everything.

Hmm. That is a bit silly. Why does it use the index if select only from
mm_mediasources?

> You can explicitly tell it what you want to do via:
> 
> SELECT *
>   FROM (SELECT * FROM mm_mediasources ORDER BY number DESC LIMIT 20 
>   UNION SELECT * FROM <subtable> ORDER BY number DESC LIMIT 20) AS tab
>  ORDER BY number DESC LIMIT 20

I think you meant 'only mm_mediasources', and btw order by and limit are not
accepted before union, so the above query does not compile.

I can't figure out any acceptable work-around. Even if something as the
above would work, it still would be hardly elegant, and you can as well have
no support for inheritance (actually, you can _better_ have no inheritance,
because at least it is clear what works then).

Michiel

btw. Why are these messages not appearing on the list itself?

-- 
Michiel Meeuwissen
Mediapark C101 Hilversum
+31 (0)35 6772979
nl_NL eo_XX en_US
mihxil'
 [] ()



view thread (5+ messages)  latest in thread

Message-ID: <20040422110214.GH6870@michiel.omroep.nl>
Permalink:  ../20040422110214.GH6870@michiel.omroep.nl/
Also on:    postgresql.org/message-id/20040422110214.GH6870@michiel.omroep.nl

 · 

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: Michiel.Meeuwissen@omroep.nl, pg@rbt.ca, performance@postgresql.org
  Subject: Re: order by index, and inheritance
  In-Reply-To: <20040422110214.GH6870@michiel.omroep.nl>

* 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