Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rxrdW-00CbiU-Hv for pgsql-admin@arkaria.postgresql.org; Fri, 19 Apr 2024 17:02:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rxrdV-003zFy-5L for pgsql-admin@arkaria.postgresql.org; Fri, 19 Apr 2024 17:02:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rxrdU-003zFk-BP for pgsql-admin@lists.postgresql.org; Fri, 19 Apr 2024 17:02:52 +0000 Received: from mail-westusazon11012009.outbound.protection.outlook.com ([52.101.85.9] helo=BY5PR09CU001.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rxrdR-003dvK-4E for pgsql-admin@postgresql.org; Fri, 19 Apr 2024 17:02:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KY9Cc6xKTs3qdBVHWFqgisEaJGeeGcgST6hK+AeBk8mjIYcfn82PPH4EoNRKgJ4I9q4UZ+3/5QHRiF/UoCfnjkBXeoEDJWTjv/Hu5ceadpFN1cur9aTghPfQl56eGL/M+T7fiWHcOGuOHmlAReB/AQpAnpIWTeeJpNuBzPgucyNV2CXtbibnk1mJjYtqEOIUBz4Q+DJKZsKmPwwOXXNWeih7kAd4hWBixVgerssIXaktsuxtT38uazze2Pq0i+UvEPK4kul7u/yUOUAaHoghQp2Lnnu/4Lbf8dPXcL8SrTP+jE2yVhsbvfybYm0reJOlDO+1q1kvOe4NbDg6tPoAFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NDe+5RKjx3nsU0Jtcatccij5xCmfM7ydrMtyIVrPJUY=; b=Y1gCw5oTOOdeWuXJvp4/JBg5k9qEHeuOl9m3YjSQwDMW/UixBMIrQTABB2laP/WeWP1mPo611CmEphH7Cdt5PaB5TF34PMT0sYZKydENQI8WkYISzRCRnPY1Btu4bNQ5Pr8QdlU4DPK1bZ2DXr6rhOUHMboGrMdBOV7tfuDERMS3xoQq0qCrgOCZmWtFHBmLDlGBVuFE20ptrb+maqj2kxZO16KaHXD4JqyklZcWAePUj+NLU6tmQKa3aGKrTvdNVD5u7J8k0sCWB7bAFJNXzTLJtRrdynjaTVfnGPzxgm/F6AJf7/VhLlld1IWkQuFLKZ00BFZyIlRYLnSZYlluCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fnal.gov; dmarc=pass action=none header.from=fnal.gov; dkim=pass header.d=fnal.gov; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fnal.gov; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NDe+5RKjx3nsU0Jtcatccij5xCmfM7ydrMtyIVrPJUY=; b=shBs+tSYCGobeXxDSxbotiCFP2C/iIIRDJRv2GAOBzkAK5phtY8SOFXND+gwOtyHovby/VUCzvdd2A9ruOA+bHmXUWMyJnYKpphDw4WWxksFLySrVaWFwK5VWXrNktPvrvDALewKUYkbOSXzA6Sg0cJ7XUFJ7o2FHbzGAkbh0D84plotqNVpemWK6o3BdkbLxJ05mjOG7+tDZN8q05xWdU0Z3pvfOqBUeY8jbVeYozRAic/UxSUFi4yz/GTEkBGBPkDFhkhkLf6ImGRfV9Pi1ziHXE6+Ny4FQSE5edUMDxF9Nzfb6rW+B+lPtfiF3pIZ5WhmKcvtettwopMV9QvAgw== Received: from DM8PR09MB6677.namprd09.prod.outlook.com (2603:10b6:5:2ee::12) by MN2PR09MB4794.namprd09.prod.outlook.com (2603:10b6:208:221::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.50; Fri, 19 Apr 2024 17:02:42 +0000 Received: from DM8PR09MB6677.namprd09.prod.outlook.com ([fe80::b868:b1dc:edcb:78f0]) by DM8PR09MB6677.namprd09.prod.outlook.com ([fe80::b868:b1dc:edcb:78f0%4]) with mapi id 15.20.7472.044; Fri, 19 Apr 2024 17:02:42 +0000 From: Murthy Nunna To: "pgsql-admin@postgresql.org" Subject: Intermittent Query Performance Issue Thread-Topic: Intermittent Query Performance Issue Thread-Index: AdqSd/11UObFWsUNRjOPKTxjXtD1VA== Date: Fri, 19 Apr 2024 17:02:41 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=fnal.gov; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM8PR09MB6677:EE_|MN2PR09MB4794:EE_ x-ms-office365-filtering-correlation-id: 61568817-dd6e-4295-ac83-08dc609286a4 x-fermilab-ob: 1 x-fermilab-sender-location: inside x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: =?us-ascii?Q?Mwy7JEJ0S7beDe5BRWqNmlFiNVd8ZddH1+f2bavM6pqdAGs8P83uhjp/aLhI?= =?us-ascii?Q?XyF1IztDfxaTBYFKC1OdPmBsgcZlq/tMasa0u3tSF2s3jc5cFToQVHgXAWxk?= =?us-ascii?Q?X8vBYXnkyN/KsFlqtxIdncGhUMWIKJp65zl58Ksj4VNplkb4YfHctv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8f8PFYLJ1Em21pdB98itGGRA4tf?= =?us-ascii?Q?I9KPht5062EIbwv59XlDf87owdFISxpzASwoidQez65r5D7U76PaCORgCCf9?= =?us-ascii?Q?PPzllpWwoF3nCO95Jd6J8Gw3TY/Pyrm130PBwz2eIRpKNI2RnTSdvs5iRLbo?= =?us-ascii?Q?2tCau0g1x5IXnUED/dVKY6rqIoThPh/PRbBF3rfbz7KpyFkW39Ii8hiLNnHT?= =?us-ascii?Q?FCxxl0QjYVXdV8RsjlCNgRI3b09v7l1xbu3rnaUOPos+UMJbcKL9G6p2vMms?= =?us-ascii?Q?QOn2nq0BfeFYnF0lkQgSjDhhfiecw98W7anrjowmfPc3fQ=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR09MB6677.namprd09.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(38070700009);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?zHlBA2RPaKXZTyoNYSOxNaP/4GSDlzd2FsnueBpzn9AA1KyIQqRFNGtQjb+8?= =?us-ascii?Q?mmohY3HwEF4uP5Ad1IGSx2FSID/XgFArn2WmKCJMiGJrTZE5siL61tMBY3M8?= =?us-ascii?Q?w6eKf9cTFRqQnRBuqBeUVVSLUQHqfJS9M/JSH5DDPnli0e4hPmevcn4PgBOL?= =?us-ascii?Q?W4CsMPruxIjCTiJyJ43XZPWWEGOLU3DRiTlQ0aF0UdkwYKbmNBtLkKO0Et8A?= =?us-ascii?Q?3gvPDo/4JNMw8IoO+jUO8B3z8LmarQZs1HbUt3o6GZK0w+NF0O9d60cKoXpk?= =?us-ascii?Q?s7N7Tj1GMvfocnxZJTUCH9EH9ztxxfS/kgA4T3e0jcictyCtdL45UEC1ccHs?= =?us-ascii?Q?1exWjReNfLQKAJv3T0C23tX5F/puW5YYu7Mow4by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33gvbwpMvjO7Y1ObLy0Zgw9b6gq+IrHk6V1/JPo9sfb?= =?us-ascii?Q?Er7ig56fju+Kj9vl30fyyR9wQaSfkSw/SoXEbAbv/h67jjjHgBjo/h2GQCnq?= =?us-ascii?Q?yoq8gp+TrkK9YfEToLO3Hz8j5ws/j1V0ShT/kC5mL3IaSl2BOq8p5YNSwR3Q?= =?us-ascii?Q?ZsVX6Rm4yE6O6fiHm2HQGP22lEPQ+vEGf1EiHNdNoz1erH/NoNr//e+Bn+j9?= =?us-ascii?Q?oAba4vp65aoWD3p58Jk3ZttWxyreO/10clYyNDxaHF4TmSV89ZVBZtpQDA19?= =?us-ascii?Q?cVsqDRYOSX+u7yAAbXuNj/oTCeziDkAsOaqibcCm?= Content-Type: multipart/alternative; boundary="_000_DM8PR09MB66772143CBEAD3538AB98906B80D2DM8PR09MB6677namp_" MIME-Version: 1.0 X-OriginatorOrg: fnal.gov X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR09MB6677.namprd09.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 61568817-dd6e-4295-ac83-08dc609286a4 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Apr 2024 17:02:41.9687 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9d5f83d3-d338-4fd3-b1c9-b7d94d70255a X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR09MB4794 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_DM8PR09MB66772143CBEAD3538AB98906B80D2DM8PR09MB6677namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I am running pg 14.4 I have a simple query : select max(c) from tab1 where name =3D 'xxx' ; This query runs some times very slow. It takes about 40 minutes. Most of the time it completes in few seconds. When it runs slow, wait_event in pg_stat_activity shows "DataFileRead". Obv= iously, it is reading from file storage and that is why it is taking so lon= g. This is a big table 512GB. It has some child tables. Is there a way I can reproduce the slowness at will, so I can attempt to tu= ne it? Or any ideas I can try to fix the issue? I hate to try something not= knowing if the problem is fixed or not. That is the reason I would like to= reproduce the issue first. Thank you all! --_000_DM8PR09MB66772143CBEAD3538AB98906B80D2DM8PR09MB6677namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

I am running pg 14.= 4

 

I have a simple que= ry :

select max(c) from = tab1 where name =3D 'xxx’ ;

 

This query runs som= e times very slow. It takes about 40 minutes.

Most of the time it= completes in few seconds.

When it runs slow, = wait_event in pg_stat_activity shows “DataFileRead”. Obviously,= it is reading from file storage and that is why it is taking so long.=

 

This is a big table= 512GB. It has some child tables.

 

Is there a way I ca= n reproduce the slowness at will, so I can attempt to tune it? Or any ideas= I can try to fix the issue? I hate to try something not knowing if the pro= blem is fixed or not. That is the reason I would like to reproduce the issue first.

 

Thank you all!=

--_000_DM8PR09MB66772143CBEAD3538AB98906B80D2DM8PR09MB6677namp_--