Re: More Performance Questions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gordan Bobic <gordan(at)bobich(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: More Performance Questions
Date: 2001-11-07 18:13:08
Message-ID: 5504.1005156788@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Gordan Bobic <gordan(at)bobich(dot)net> writes:
> And is the overhead of running multiple UNION queries greater than the
> overhead of doing a DISTINCT? I need to sort the records anyway, so the fact
> that DISTINCT does a SORT is a bonus in this case.

UNION implies DISTINCT, so you're going to get sort and uniq steps in
either case. What this is really going to boil down to is how the
restriction and join steps are done, and you haven't given enough info
to speculate about that. Try some experimentation with EXPLAIN to see
what kinds of plans you get.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gordan Bobic 2001-11-07 18:14:59 Re: Performance Question Followup No.2
Previous Message Gordan Bobic 2001-11-07 18:10:08 Re: Performance Question Followup No.2