Re: Performance difference when using views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Nunes Melo <al_nunes(at)atua(dot)com(dot)br>
Cc: Pgsql-Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Performance difference when using views
Date: 2004-11-01 22:08:28
Message-ID: 27481.1099346908@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Alvaro Nunes Melo <al_nunes(at)atua(dot)com(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Simon Riggs 2004-11-01 22:28:50 Re: Performance difference when using views
Previous Message Simon Riggs 2004-11-01 22:03:58 Re: [PERFORM] [PATCHES] ARC Memory Usage analysis