pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Klint Gore <kg@kgb.une.edu.au>
Cc: pgsql-performance@postgresql.org, Gaetano Mendola <mendola@bigfoot.com>
Subject: Re: bad performances using hashjoin
Date: Sun, 20 Feb 2005 21:01:17 -0500
Message-ID: <20287.1108951277@sss.pgh.pa.us> (raw)
In-Reply-To: <421939AD2A4.CE73KG@129.180.47.120>
References: <cv9vbh$1j1o$1@news.hub.org>
	<15413.1108925170@sss.pgh.pa.us>
	<421939AD2A4.CE73KG@129.180.47.120>

Klint Gore <kg@kgb.une.edu.au> writes:
> Is having an order by in a view legal?

Not according to the SQL spec, but PG has allowed it for several releases.
(The same goes for ORDER BY in a sub-select, which is actually pretty
much the same thing ...)

> If so, does it do 2 sorts when you sort by something else?

Yup.  It's something you'd only want for the topmost view in a stack,
IMHO.  A sort at a lower level is likely to be wasted effort.

			regards, tom lane



view thread (10+ messages)  latest in thread

Message-ID: <20287.1108951277@sss.pgh.pa.us>
Permalink:  ../20287.1108951277@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20287.1108951277@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, kg@kgb.une.edu.au, mendola@bigfoot.com
  Subject: Re: bad performances using hashjoin
  In-Reply-To: <20287.1108951277@sss.pgh.pa.us>

* 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