pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Luke Lonergan <llonergan@greenplum.com>
To: Gregory Stark <stark@enterprisedb.com>
To: Mark Kirkwood <markir@paradise.net.nz>
Cc: Heikki Linnakangas <heikki@enterprisedb.com>
Cc: Anton <anton200@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: partitioned table and ORDER BY indexed_field DESC LIMIT 1
Date: Wed, 07 Nov 2007 22:40:20 -0800
Message-ID: <C357EF54.44FA2%llonergan@greenplum.com> (raw)
In-Reply-To: <87ode5uujt.fsf@oxford.xeocode.com>

On 11/7/07 10:21 PM, "Gregory Stark" <stark@enterprisedb.com> wrote:

>> part=# explain SELECT * FROM n_traf ORDER BY date_time LIMIT 1;
>>                                                                   QUERY PLAN
>> -----------------------------------------------------------------------------
>> --------------------------------------------------------------------
>> Limit  (cost=198367.14..198367.15 rows=1 width=20)
>>   ->  Sort  (cost=198367.14..200870.92 rows=1001510 width=20)
>>         Sort Key: public.n_traf.date_time
>>         ->  Result  (cost=0.00..57464.92 rows=1001510 width=20)
>>               ->  Append  (cost=0.00..57464.92 rows=1001510 width=20)
>>                     ->  Index Scan using n_traf_date_time_login_id on n_traf
>> (cost=0.00..66.90 rows=1510 width=20)
> 
> That looks suspicious. There's likely no good reason to be using the index
> scan unless it avoids the sort node above the Append node. That's what I hope
> to do by having the Append executor code do what's necessary to maintain the
> order.

Yah - the way it works in GPDB is that you get a non-sorting plan with an
index scan below the parent - that was the point of the fix. Hmm.

- Luke





view thread (33+ messages)  latest in thread

Message-ID: <C357EF54.44FA2%llonergan@greenplum.com>
Permalink:  ../C357EF54.44FA2%25llonergan@greenplum.com/
Also on:    postgresql.org/message-id/C357EF54.44FA2%llonergan@greenplum.com

 · 

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: llonergan@greenplum.com, stark@enterprisedb.com, markir@paradise.net.nz, heikki@enterprisedb.com, anton200@gmail.com
  Subject: Re: partitioned table and ORDER BY indexed_field DESC LIMIT 1
  In-Reply-To: <C357EF54.44FA2%llonergan@greenplum.com>

* 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