Re: Postgres not using index on views - Mailing list pgsql-performance

From Laurenz Albe
Subject Re: Postgres not using index on views
Date
Msg-id 1b2a5b7c6c3a5610be90944ab43c3b53a4def335.camel@cybertec.at
Whole thread Raw
In response to Postgres not using index on views  (Rick Vincent <rvincent@temenos.com>)
List pgsql-performance
On Mon, 2020-04-06 at 14:19 +0000, Rick Vincent wrote:
> I am seeing a performance problem with postgresql v 11.7 on views, and I am wondering if
> anyone can tell me why or has any suggestion.

Your account is somewhat confused - too many questions rolled into one
rant, I would say.

There are two points that may clear up the case:

- If you have no WHERE clause, a sequential scan of the table is usually
  the best way to do it.  The exception is an index only scan if the index
  contains all that is required, but in PostgreSQL you need a recently
  VACUUMed table for that.

- The expensive part in your view is the "extractValueJS" function.
  Try to tune that for better performance.

If any of your problems are not explained by that, please say so.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Postgres not using index on views
Next
From: Rick Vincent
Date:
Subject: RE: Postgres not using index on views