Re: slow query to improve performace - Mailing list pgsql-performance

From Jeff Janes
Subject Re: slow query to improve performace
Date
Msg-id CAMkU=1wUubr0coupaEBo6u8pyOHt+HLxH=qZ+fidJUp81f53jQ@mail.gmail.com
Whole thread Raw
In response to slow query to improve performace  (Ayub Khan <ayub.hp@gmail.com>)
List pgsql-performance
On Fri, Feb 25, 2022 at 3:18 PM Ayub Khan <ayub.hp@gmail.com> wrote:
Hi,

Could some some verify the attached query to verify the performance and suggest some steps to improve it, this query is created as a view. This view is used to get the aggregates of orders based on its current status

I don't see how it is possible for that query to yield that plan. For example, what part of that query could have been transformed into this part of the plan "order_status_code <> ALL ('{T,J,C,D}'::bpchar[])"?

Well, I suppose some of the tables used in that query could themselves be views over the same tables?  In that case, we might need to know the definitions of those views.  As well as knowing the version, and seeing the EXPLAIN (ANALYZE, BUFFERS) for the query, run after track_io_timing is turned on.

Cheers,

Jeff

pgsql-performance by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Never Ending query in PostgreSQL
Next
From: "ldh@laurent-hasson.com"
Date:
Subject: RE: An I/O error occurred while sending to the backend (PG 13.4)