Re: Query question

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, PostgreSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Query question
Date: 2003-11-13 05:20:28
Message-ID: 200311122120.28882.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Chris,

> SELECT * FROM (arbitrary subquery) AS sub ORDER BY 1,3;
>
> Now, this all works fine, but I want to know if this is efficient or not.
>
> Does doing a select of a select cause serious performance degradation?

It would be better if you could strip out the inner sort, but I can understand
why that might not be possible in all cases.

The only thing you're adding to the query is a second SORT step, so it
shouldn't require any more time/memory than the query's first SORT did.

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Suchandra Thapa 2003-11-13 05:58:45 Re: performance optimzations
Previous Message Rod Taylor 2003-11-13 04:35:33 Re: performance optimzations