pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rickard Sjöström <rickard.sjostrom@bluebottle.com>
To: pgsql-admin@postgresql.org
Subject: Performance on views
Date: Fri, 30 Mar 2007 04:19:30 -0700
Message-ID: <1175253570.460cf2427984c@mail.bluebottle.com> (raw)

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 table directly.

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/




view thread (2+ messages)  latest in thread

Message-ID: <1175253570.460cf2427984c@mail.bluebottle.com>
Permalink:  ../1175253570.460cf2427984c@mail.bluebottle.com/
Also on:    postgresql.org/message-id/1175253570.460cf2427984c@mail.bluebottle.com

 · 

reply

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-admin@postgresql.org
  Cc: rickard.sjostrom@bluebottle.com
  Subject: Re: Performance on views
  In-Reply-To: <1175253570.460cf2427984c@mail.bluebottle.com>

* 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