Query performance issue

From: Dheeraj Sonawane <Dheeraj(dot)Sonawane(at)ethoca(dot)com>
To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Cc: Chandan Sonaye <Chandan(dot)Sonaye(at)ethoca(dot)com>, Abhishek Patil <Abhishek(dot)Patil(at)ethoca(dot)com>
Subject: Query performance issue
Date: 2024-07-10 07:11:39
Message-ID: DS0PR14MB7157B75FB7BFC4006204DC93F4A42@DS0PR14MB7157.namprd14.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hello all,

While executing the join query on the postgres database we have observed sometimes randomly below query is being fired which is affecting our response time.

Query randomly fired in the background:-
SELECT p.proname,p.oid FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n WHERE p.pronamespace=n.oid AND n.nspname='pg_catalog' AND ( proname = 'lo_open' or proname = 'lo_close' or proname = 'lo_creat' or proname = 'lo_unlink' or proname = 'lo_lseek' or proname = 'lo_lseek64' or proname = 'lo_tell' or proname = 'lo_tell64' or proname = 'loread' or proname = 'lowrite' or proname = 'lo_truncate' or proname = 'lo_truncate64')

Query intended to be executed:-
SELECT a.* FROM tablename1 a INNER JOIN users u ON u.id = a.user_id INNER JOIN tablename2 c ON u.client_id = c.id WHERE u.external_id = ? AND c.name = ? AND (c.namespace = ? OR (c.namespace IS NULL AND ? IS NULL))

Postgres version 11

Below are my questions:-

1. Is the query referring pg_catalog fired by postgres library implicitly?
2. Is there any way we can suppress this query?

Thanks and regards,
Dheeraj Sonawane

Mastercard
| mobile +917588196818
[cid:image001(dot)png(at)01DAD2C5(dot)3D8927C0]<www.mastercard.com>

CONFIDENTIALITY NOTICE This e-mail message and any attachments are only for the use of the intended recipient and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient, any disclosure, distribution or other use of this e-mail message or attachments is prohibited. If you have received this e-mail message in error, please delete and notify the sender immediately. Thank you.

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2024-07-10 13:40:07 Re: Query performance issue
Previous Message Andrei Lepikhov 2024-07-08 07:24:53 Re: Low performance between datacenters