Re: Understanding sequential versus index scans.

From: Robert James <srobertjames(at)gmail(dot)com>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Understanding sequential versus index scans.
Date: 2009-07-20 13:22:19
Message-ID: e09785e00907200622t532ff2baqa367b7418dda3011@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes, I had done UNION. UNION ALL achives the expected plan and speed! Thank
you!
BTW, this is interesting, because there are only about 5 or 6 rows max
returned from both queries - but I guess the planner expects more and hence
changes the plan to remove duplicates.

On Sun, Jul 19, 2009 at 9:05 PM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>wrote:

> On Sun, Jul 19, 2009 at 6:10 PM, Robert James<srobertjames(at)gmail(dot)com>
> wrote:
> > UNION was better, but still 5 times as slow as either query done
> > individually.
> > set enable_seqscan=off didn't help at all - it was totally ignored
> > Is there anything else I can do?
>
> Did you try union, or union all?
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert James 2009-07-20 13:34:00 Documentation Improvement suggestions
Previous Message Andreas Wenk 2009-07-20 11:10:09 Re: Full text search in PostgreSQL 8.4