[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pgsql-performance
Subject:    Re: [PERFORM] seqscan on UNION'ed views
From:       Tom Lane <tgl () sss ! pgh ! pa ! us>
Date:       2013-02-27 14:21:18
Message-ID: 17937.1361974878 () sss ! pgh ! pa ! us
[Download RAW message or body]

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


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic