Re: Searching union views not using indices

From: Richard Huxton <dev(at)archonet(dot)com>
To: Michal Taborsky <michal(dot)taborsky(at)mall(dot)cz>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Searching union views not using indices
Date: 2005-11-04 15:01:05
Message-ID: 436B77B1.7090602@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Michal Taborsky wrote:
...
> UNION
...
> The result is sequential scan on all tables, append, sort and then
> filter scan on this whole thing. Which of course is slow as hell. We use
> version 8.0.2.
>
> And now the question: Is there a way to force the planner to push the
> condition lower, so it will use the index? Or do you use some tricks in
> this scenario? Thanks for your suggestions.

Try "UNION ALL", since UNION is defined as removing duplicates, which
probably accounts for the sort.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Merlin Moncure 2005-11-04 15:07:53 Re: Searching union views not using indices
Previous Message Tom Lane 2005-11-04 14:59:20 Re: insert performance for win32