pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Rick Vincent <rvincent@temenos.com>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Cc: Manoj Kumar <manojkumar@temenos.com>
Cc: Herve Aubert <haubert@temenos.com>
Subject: Re: Postgres not using index on views
Date: Tue, 07 Apr 2020 08:42:35 +0200
Message-ID: <1b2a5b7c6c3a5610be90944ab43c3b53a4def335.camel@cybertec.at> (raw)
In-Reply-To: <DM6PR04MB492354C0895FB26EDFBE1D82C1C20@DM6PR04MB4923.namprd04.prod.outlook.com>
References: <DM6PR04MB492354C0895FB26EDFBE1D82C1C20@DM6PR04MB4923.namprd04.prod.outlook.com>

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






view thread (12+ messages)  latest in thread

Message-ID: <1b2a5b7c6c3a5610be90944ab43c3b53a4def335.camel@cybertec.at>
Permalink:  ../1b2a5b7c6c3a5610be90944ab43c3b53a4def335.camel@cybertec.at/
Also on:    postgresql.org/message-id/1b2a5b7c6c3a5610be90944ab43c3b53a4def335.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: laurenz.albe@cybertec.at, rvincent@temenos.com, manojkumar@temenos.com, haubert@temenos.com
  Subject: Re: Postgres not using index on views
  In-Reply-To: <1b2a5b7c6c3a5610be90944ab43c3b53a4def335.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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