From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Nunes Melo <al_nunes@atua.com.br>
Cc: Pgsql-Performance <pgsql-performance@postgresql.org>
Subject: Re: Performance difference when using views
Date: Mon, 01 Nov 2004 17:08:28 -0500
Message-ID: <27481.1099346908@sss.pgh.pa.us> (raw)
In-Reply-To: <1099345230.8204.30.camel@localhost>
References: <1099345230.8204.30.camel@localhost>
Alvaro Nunes Melo <al_nunes@atua.com.br> writes:
> I have some views that are used to make some queries simplest. But when
> I use them there is a performance loss, because the query don't use
> indexes anymore. Below I'm sending the query with and without the view,
> its execution times, explains and the view's body.
It's not the same query, because you are implicitly changing the order
of the LEFT JOINs when you group some of them into a subquery (view).
Join order is significant for outer joins ...
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, al_nunes@atua.com.br
Subject: Re: Performance difference when using views
In-Reply-To: <27481.1099346908@sss.pgh.pa.us>
* 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