Re: seqscan on UNION'ed views - Mailing list pgsql-performance

From Tom Lane
Subject Re: seqscan on UNION'ed views
Date
Msg-id 17937.1361974878@sss.pgh.pa.us
Whole thread Raw
In response to seqscan on UNION'ed views  (Dmitry Karasik <dmitry@karasik.eu.org>)
List pgsql-performance
Dmitry Karasik <dmitry@karasik.eu.org> writes:
> I need to have a sort of a time machine, where select statements on tables
> could be easily replaced to select statements on tables as they were some time in the past,
> including all related table. To do so, I used views (see in the script) that UNION
> both current and archive tables and filter them by a timestamp.

If you use UNION ALL instead of UNION, you should get better results
(as well as inherently cheaper queries, since no duplicate-elimination
step will be needed).

            regards, tom lane


pgsql-performance by date:

Previous
From: Andre
Date:
Subject: Re: Server stalls, all CPU 100% system time
Next
From: Matt Daw
Date:
Subject: Re: Estimation question...