pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <maillist@candle.pha.pa.us>
To: jwieck@debis.com
Cc: lockhart@alumni.caltech.edu
Cc: jwieck@debis.com
Cc: eric@linux-hw.com
Cc: jeff@remapcorp.com
Cc: hackers@postgreSQL.org
Subject: Re: [HACKERS] What about LIMIT in SELECT ?
Date: Thu, 15 Oct 1998 01:52:06 -0400 (EDT)
Message-ID: <199810150552.BAA07576@candle.pha.pa.us> (raw)
In-Reply-To: <m0zTY6V-000EBRC@orion.SAPserv.Hamburg.dsh.de>

> > I have had more time to think about this.  Basically, for pre-sorted
> > data, our psort code is very fast, because it does not need to sort
> > anything.  It just moves the rows in and out of the sort memory.  Yes,
> > it could be removed in some cases, and probably should be, but it is not
> > going to produce great speedups.
> 
>     And I got the time to hack around about this.
> 
>     I  hacked  in  a little check into the planner, that compares
>     the sortClause against the key field list of  an  index  scan
>     and  just  suppresses  the sort node if it exactly matchs and
>     all sort operators are "<".
> 
>     I tested with a 10k row table where key is a text field.  The
>     base query is a
> 
>         SELECT ... WHERE key > 'val' ORDER BY key;
> 
>     The  used 'val' is always a key that is close to the first of
>     all keys in the table ('' on the first  query  and  the  last
>     selected value on subsequent ones).

This is good stuff.  I want to think about it for a day.  Sounds very
promising.


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



view thread (60+ messages)  latest in thread

Message-ID: <199810150552.BAA07576@candle.pha.pa.us>
Permalink:  ../199810150552.BAA07576@candle.pha.pa.us/
Also on:    postgresql.org/message-id/199810150552.BAA07576@candle.pha.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: maillist@candle.pha.pa.us, jwieck@debis.com, lockhart@alumni.caltech.edu, eric@linux-hw.com, jeff@remapcorp.com, hackers@postgreSQL.org
  Subject: Re: [HACKERS] What about LIMIT in SELECT ?
  In-Reply-To: <199810150552.BAA07576@candle.pha.pa.us>
  References: <m0zTY6V-000EBRC@orion.SAPserv.Hamburg.dsh.de> <199810150552.BAA07576@candle.pha.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