pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steinar H. Gunderson <sgunderson@bigfoot.com>
To: pgsql-performance@postgresql.org
Subject: Re: Performance pb vs SQLServer.
Date: Mon, 15 Aug 2005 03:37:41 +0200
Message-ID: <20050815013741.GA32106@uio.no> (raw)
In-Reply-To: <14401.1124068725@sss.pgh.pa.us>
References: <20050811131911.3175A1C0031B@mwinf0401.wanadoo.fr>
	<42FFE17A.6010208@arbash-meinel.com>
	<20050815010159.GA27795@uio.no>
	<14401.1124068725@sss.pgh.pa.us>

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/



view thread (16+ messages)  latest in thread

Message-ID: <20050815013741.GA32106@uio.no>
Permalink:  ../20050815013741.GA32106@uio.no/
Also on:    postgresql.org/message-id/20050815013741.GA32106@uio.no

 · 

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: sgunderson@bigfoot.com
  Subject: Re: Performance pb vs SQLServer.
  In-Reply-To: <20050815013741.GA32106@uio.no>

* 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