Re: Postgres not using index on views

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Rick Vincent <rvincent(at)temenos(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Cc: Manoj Kumar <manojkumar(at)temenos(dot)com>, Herve Aubert <haubert(at)temenos(dot)com>
Subject: Re: Postgres not using index on views
Date: 2020-04-07 06:42:35
Message-ID: 1b2a5b7c6c3a5610be90944ab43c3b53a4def335.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Rick Vincent 2020-04-07 07:53:46 RE: Postgres not using index on views
Previous Message Tom Lane 2020-04-07 05:09:09 Re: Postgres not using index on views