pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Performance on views
2+ messages / 2 participants
[nested] [flat]

* Performance on views
@ 2007-03-30 11:19 Rickard Sjöström <rickard.sjostrom@bluebottle.com>
  2007-03-30 16:14 ` Re: Performance on views Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Rickard Sjöström @ 2007-03-30 11:19 UTC (permalink / raw)
  To: 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 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/




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Performance on views
  2007-03-30 11:19 Performance on views Rickard Sjöström <rickard.sjostrom@bluebottle.com>
@ 2007-03-30 16:14 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2007-03-30 16:14 UTC (permalink / raw)
  To: Rickard Sjöström <rickard.sjostrom@bluebottle.com>; +Cc: pgsql-admin

Rickard =?iso-8859-1?b?U2r2c3Ry9m0=?= <rickard.sjostrom@bluebottle.com> writes:
> 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.

Let's see the exact definition of the view and EXPLAIN ANALYZE results
for doing it both ways.  Also, what PG version is this?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2007-03-30 16:14 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-03-30 11:19 Performance on views Rickard Sjöström <rickard.sjostrom@bluebottle.com>
2007-03-30 16:14 ` Tom Lane <tgl@sss.pgh.pa.us>

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