From: Bruno Wolff III <bruno@wolff.to>
To: Rod Taylor <rbt@rbt.ca>
Cc: Brian Tarbox <btarbox@theworld.com>
Cc: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: are views typically any faster/slower than equivilent joins?
Date: Sun, 1 Jun 2003 00:43:37 -0500
Message-ID: <20030601054337.GD16259@wolff.to> (raw)
In-Reply-To: <1054440158.11968.86.camel@jester>
References: <001801c327e9$3c01a5b0$01000001@trouble>
<1054440158.11968.86.camel@jester>
On Sun, Jun 01, 2003 at 00:02:39 -0400,
Rod Taylor <rbt@rbt.ca> wrote:
>
> Some views such as unions will not be as fast as you would like, but
> thats a general issue with PostgreSQLs inability to throw away selects
> when it won't find results on one side of a union.
>
> CREATE VIEW sales AS SELECT * FROM sales_archive_2002 UNION ALL SELECT *
> FROM sales_current;
>
>
> SELECT * FROM sales WHERE timestamp => CURRENT_TIMESTAMP - INTERVAL '1
> day';
>
> The above query would not be so quick.
I thought some work had been done on pushing where conditions down into
unions? If so the above wouldn't be too bad. It would still look at
the archive table, but it should return no rows relatively quickly
assuming an appropiate index exists.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: bruno@wolff.to, rbt@rbt.ca, btarbox@theworld.com
Subject: Re: are views typically any faster/slower than equivilent joins?
In-Reply-To: <20030601054337.GD16259@wolff.to>
References: <001801c327e9$3c01a5b0$01000001@trouble> <1054440158.11968.86.camel@jester> <20030601054337.GD16259@wolff.to>
* 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