pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Aaron Bono <postgresql@aranya.com>
Cc: Joe <dev@freedomcircle.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Repetitive code
Date: 16 Jun 2006 11:57:13 -0400
Message-ID: <87lkrx6qli.fsf@stark.xeocode.com> (raw)
In-Reply-To: <bf05e51c0606160744m5f28243cjf0fd6da11f48404d@mail.gmail.com>
References: <44920AA7.7070709@freedomcircle.net>
	<bf05e51c0606151926n18555a65x28a0156f8bd217cc@mail.gmail.com>
	<4492B248.7040406@freedomcircle.net>
	<bf05e51c0606160744m5f28243cjf0fd6da11f48404d@mail.gmail.com>


"Aaron Bono" <postgresql@aranya.com> writes:

> I haven't stared at your query as long as you have so I may have missed
> something

Likewise I'm perhaps speaking too quickly, but at the risk of making a fool of
myself: you should perhaps realize that UNION has to do a fair amount of work
to eliminate duplicates. If you know the rows are going to be distinct or if
you don't care about duplicates you can save a lot of time by using UNION ALL
instead.

-- 
greg




view thread (8+ messages)

Message-ID: <87lkrx6qli.fsf@stark.xeocode.com>
Permalink:  ../87lkrx6qli.fsf@stark.xeocode.com/
Also on:    postgresql.org/message-id/87lkrx6qli.fsf@stark.xeocode.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-sql@postgresql.org
  Cc: gsstark@mit.edu, postgresql@aranya.com, dev@freedomcircle.net
  Subject: Re: Repetitive code
  In-Reply-To: <87lkrx6qli.fsf@stark.xeocode.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