Thread: View performance degraded between 8.1 and 8.3

View performance degraded between 8.1 and 8.3

From
Mark Roghelia
Date:
I've got an application that pulls stock information from the web and
performs a bunch of calculations on them.  There is a "stock" table
and then for convenience I've got a view called "stock_calculations".
This view is defined as a stock id column coupled with 30-some
calculated columns.  Some of these columns are computationally intense
and are delegated to functions.

If I ever "select * from stock_calculations", the query is
understandable pretty slow, since it has to do every one of the
calculations for each stock.  However, in 8.1, if I only selected a
couple of specific columns from the view, it ran very quickly.  I
assumed that the database did not bother calculating all the other
columns it didn't need.

Unfortunately, I've recently upgraded to 8.3 and found that selecting
a single column from this view has now become as slow as selecting all
of them.

I'm wondering if there is any thing that I can do about this short of
downgrading to 8.1?  Are there any configuration parameters that
effect this behavior?

Thanks,

Mark


Re: View performance degraded between 8.1 and 8.3

From
Tom Lane
Date:
Mark Roghelia <mroghelia@topsailtech.com> writes:
> Unfortunately, I've recently upgraded to 8.3 and found that selecting
> a single column from this view has now become as slow as selecting all
> of them.

Without specifics there's really no way to answer this.

            regards, tom lane