Temp tbl Vs. View - Mailing list pgsql-sql

From Radhika Sambamurti
Subject Temp tbl Vs. View
Date
Msg-id 60666.63.118.86.10.1175181985.squirrel@www.88thstreet.com
Whole thread Raw
Responses Re: Temp tbl Vs. View  (Richard Broersma Jr <rabroersma@yahoo.com>)
Re: Temp tbl Vs. View  ("Rodrigo De León" <rdeleonp@gmail.com>)
List pgsql-sql
Hello,

I have an interesing problem relating to sql and performance issues and am
looking at ways I can increase the performace from postgres.

Currently I have a view created from two tables. All the selects are being
done on the view - which normally does not take a lot of time, but because
my web app uses filtering on such as symbol ~ '^.*$', side, date etc, the
select from the view is taking a lot of time (7000 ms) as per explain
analyze. Both the primary and secondary tables have about 400,000 rows.

I noticed that it is doing a sequential scan on the primary table which is
joined to the secondary table in the view query.

I just read when I use filters that postgres will do a seq scan on the table.

My question is how can I fix this?
Would it be better to create a temporary table for just daily data and
have the view for more extended queries? Any other design ideas?

Thanks,
Radhika

-- 
It is all a matter of perspective. You choose your view by choosing where
to stand.
Larry Wall
---



pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: SELECT INSTEAD
Next
From: Richard Broersma Jr
Date:
Subject: Re: Temp tbl Vs. View