Re: Understanding sequential versus index scans. - Mailing list pgsql-general

From Robert James
Subject Re: Understanding sequential versus index scans.
Date
Msg-id e09785e00907200622t532ff2baqa367b7418dda3011@mail.gmail.com
Whole thread Raw
In response to Re: Understanding sequential versus index scans.  (Scott Marlowe <scott.marlowe@gmail.com>)
Responses Re: Understanding sequential versus index scans.
List 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.marlowe@gmail.com> wrote:
On Sun, Jul 19, 2009 at 6:10 PM, Robert James<srobertjames@gmail.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?

pgsql-general by date:

Previous
From: Arndt Lehmann
Date:
Subject: Re: PostgreSQL Databse Migration to the Latest Version and Help for Database Replication.
Next
From: Robert James
Date:
Subject: Documentation Improvement suggestions