Re: More Performance Questions - Mailing list pgsql-general

From Tom Lane
Subject Re: More Performance Questions
Date
Msg-id 5504.1005156788@sss.pgh.pa.us
Whole thread Raw
In response to More Performance Questions  (Gordan Bobic <gordan@bobich.net>)
List pgsql-general
Gordan Bobic <gordan@bobich.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

pgsql-general by date:

Previous
From: Javier Dussaillant
Date:
Subject: Re: Old Template0 is annoying me!
Next
From: Tom Lane
Date:
Subject: Re: [pgadmin-hackers] Fwd: Re: Howto change column