pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Dave Dutcher <dave@tridecap.com>
Cc: nikolay@samokhvalov.com
Cc: pgsql-performance@postgresql.org
Subject: Re: Query plan for "heavy" SELECT with "lite" sub-SELECTs
Date: Thu, 2 Nov 2006 16:15:55 -0300
Message-ID: <20061102191555.GL25444@alvh.no-ip.org> (raw)
In-Reply-To: <012a01c6fe8a$bee330e0$8300a8c0@tridecap.com>
References: <e431ff4c0611020307x1fca3a14w16f60dbd80d0e856@mail.gmail.com>
	<012a01c6fe8a$bee330e0$8300a8c0@tridecap.com>

Dave Dutcher wrote:
> > -----Original Message-----
> > From: pgsql-performance-owner@postgresql.org 
> > Nikolay Samokhvalov
> > 
> > What should I do to make Postgres work properly in such cases (I have
> > a lot of similar queries; surely, they are executed w/o seqscans, but
> > overall picture is the same - I see that starting from sub-selects
> > dramatically decrease performance)?
> 
> How about this:
> 
> explain analyze 
> select (select typname from pg_type where pg_type.oid=mainq.prorettype limit
> 1)
> from (select * from pg_proc offset 1500 limit 1) mainq;

What's the use of such a query?  One would think that in the real world,
you'd at least have an ORDER BY somewhere in the subqueries.

Performance analysis of strange queries is useful, but the input queries
have to be meaningful as well.  Otherwise you end up optimizing bizarre
and useless cases.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



view thread (6+ messages)  latest in thread

Message-ID: <20061102191555.GL25444@alvh.no-ip.org>
Permalink:  ../20061102191555.GL25444@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20061102191555.GL25444@alvh.no-ip.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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: alvherre@commandprompt.com, dave@tridecap.com, nikolay@samokhvalov.com
  Subject: Re: Query plan for "heavy" SELECT with "lite" sub-SELECTs
  In-Reply-To: <20061102191555.GL25444@alvh.no-ip.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