pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Michal Taborsky <michal.taborsky@mall.cz>
Cc: pgsql-performance@postgresql.org
Subject: Re: Searching union views not using indices
Date: Fri, 04 Nov 2005 15:01:05 +0000
Message-ID: <436B77B1.7090602@archonet.com> (raw)
In-Reply-To: <436B4836.7030300@mall.cz>
References: <436B4836.7030300@mall.cz>

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



view thread (7+ messages)  latest in thread

Message-ID: <436B77B1.7090602@archonet.com>
Permalink:  ../436B77B1.7090602@archonet.com/
Also on:    postgresql.org/message-id/436B77B1.7090602@archonet.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-performance@postgresql.org
  Cc: dev@archonet.com, michal.taborsky@mall.cz
  Subject: Re: Searching union views not using indices
  In-Reply-To: <436B77B1.7090602@archonet.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