Performance on views - Mailing list pgsql-admin

From Rickard Sjöström
Subject Performance on views
Date
Msg-id 1175253570.460cf2427984c@mail.bluebottle.com
Whole thread Raw
Responses Re: Performance on views
List pgsql-admin
Hi!
I've probably missed somthing but here is my problem.

I have a view that is really slow and I ca easily work around the slowness by bypassing the view and query the real
tabledirectly. 

Example:
--------------------------------------------
From view, the slow one:
SELECT * from my_view WHERE date > 2007-03-01

and to speed it up I just copy the view defintion and inserts some "date > ...", like this.

SELECT *
FROM (select * from my_table where data > 2007-03-01) mt,
         my JOIN someother on mt.id=smoeother.id
         etc,...
--------------------------------------------

The thing here is that I limit the query before joining with other data.

Did I get through with my problem?
Any ideas how I can speed up my views?
Is there something I can tell the database in order to speed up?
Is this a known issue with views?

/Rickard

----------------------------------------------------------------------
Click to lower your debt and consolidate your monthly expenses
http://tags.bluebottle.com/fc/CAaCMPJklAkSFsDVLmOtm1fwWle86ZFg/


pgsql-admin by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: trying to run PITR recovery
Next
From: "Simon Riggs"
Date:
Subject: Re: recovering using a continuous archive backup doesn'twork on Windows