Re: Performance pb vs SQLServer. - Mailing list pgsql-performance

From Steinar H. Gunderson
Subject Re: Performance pb vs SQLServer.
Date
Msg-id 20050815013741.GA32106@uio.no
Whole thread Raw
In response to Re: Performance pb vs SQLServer.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
On Sun, Aug 14, 2005 at 09:18:45PM -0400, Tom Lane wrote:
> Not really.  There's been some speculation about implementing index
> "skip search" --- once you've verified there's at least one visible
> row of a given index value, tell the index to skip to the next different
> value instead of handing back any of the remaining entries of the
> current value.  But it'd be a lot of work and AFAICS not useful for
> very many kinds of queries besides this.

This is probably a completely wrong way of handling it all, but could it be
done in a PL/PgSQL query like this? (Pseudo-code, sort of; I'm not very well
versed in the actual syntax, but I'd guess you get the idea.)

x = ( SELECT foo FROM table ORDER BY foo LIMIT 1 );
WHILE x IS NOT NULL
  RETURN NEXT x;
  x = ( SELECT foo FROM table WHERE foo > x ORDER BY foo LIMIT 1 );
END;

(Replace with max() and min() for 8.1, of course.)

/* Steinar */
- fond of horrible hacks :-)
--
Homepage: http://www.sesse.net/

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Performance pb vs SQLServer.
Next
From: dario_d_s@unitech.com.ar
Date:
Subject: Re: Performance pb vs SQLServer.