pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: Miroslav ?ulc <miroslav.sulc@startnet.cz>
Cc: pgsql-sql@postgresql.org
Subject: Re: SELECT DISTINCT too slow
Date: Thu, 01 Jun 2006 20:59:05 +0200
Message-ID: <87d5dsn1mu.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <20060601154613.GC19388@surnet.cl>
References: <447EEAF1.7040305@startnet.cz>
	<12554.1149175230@sss.pgh.pa.us>
	<447F0A44.3080500@startnet.cz>
	<20060601154613.GC19388@surnet.cl>

* Alvaro Herrera:

> Miroslav ?ulc wrote:
>> The GROUP BY is really fast :-)
>
> Doh!  How does it do it?

It uses a hash table and can therefore discard duplicate rows more
quickly (essentially linear time in the number of rows if the number
of different rows is bounded).



view thread (13+ messages)

Message-ID: <87d5dsn1mu.fsf@mid.deneb.enyo.de>
Permalink:  ../87d5dsn1mu.fsf@mid.deneb.enyo.de/
Also on:    postgresql.org/message-id/87d5dsn1mu.fsf@mid.deneb.enyo.de

 · 

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-sql@postgresql.org
  Cc: fw@deneb.enyo.de, miroslav.sulc@startnet.cz
  Subject: Re: SELECT DISTINCT too slow
  In-Reply-To: <87d5dsn1mu.fsf@mid.deneb.enyo.de>

* 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