Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jwLVt-00029J-FD for pgsql-general@arkaria.postgresql.org; Fri, 17 Jul 2020 08:14:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jwLVs-0003F6-9n for pgsql-general@arkaria.postgresql.org; Fri, 17 Jul 2020 08:14:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jwLVr-0003Ev-R6 for pgsql-general@lists.postgresql.org; Fri, 17 Jul 2020 08:14:36 +0000 Received: from mail-db8eur05on2075.outbound.protection.outlook.com ([40.107.20.75] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jwLVo-0003ie-Da for pgsql-general@lists.postgresql.org; Fri, 17 Jul 2020 08:14:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ICFbGrxJBlhpM7euqnBxno4LYgm0iUJEH3bS2bc95o0H0ZO10my9EaW1jPD+YTUn5gS7OmF6QMlGOcqx6NtlXokBHEyhGQpfv0w2ZKZZXVC9awSk7zhSLzRyIg7cdMJia6PSu584d1CSkh7Hwpn9jMAmo5uESdgfTQma4mJB9uT1gmx9/PYcEddpyUK15GQB3x1iAJTAvVB0/IYNNrv4Hcq9AjrDEpcLUkVdD+NE49qcsucWrda0UqFTwFD0iGU5CtvbfRwsHcqNhg7NN0duBCStilOqFZ34zSbEeYrJwkN9MB/GtKOUNOyYeIJBxIqR0tsT+95tjcUoj/1cyujZAw== 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-SenderADCheck; bh=0xKhjE2AqHC9v+mrg8bk1mlx4XSATpRUEaUA/CgJmbY=; b=dYCiYt5qqoepgnvtpPK7jlfQu0pSO7+O6zPwksonclhNWTDtapPxGVuK4E1p2Doytxw/8+LCVT3oSA7ILDhcgGkXJX0IlBsOSIeiQg6zQhQhf0CecPwkaCwrJGVpAAfo1LHeGgr0JZHJiSP0ISZCDrGtGCXOfyDI2eCQYDczbYYkz+UlQy1hqaIq9X6UoC1KYPzDjG5hiYs/cmwktuzPtnbkUF/ORlTWHxnV+voYQuX7Pq/LRwiaG+9jouiJJ32f/6iRVSST8gCC4WrtQhycSaUl69AY/3s/C+KXhfjtFgdnuqJiRrvspaTB1iqo/XQtwPZoM2iwGIMNIwsTx5wvxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ucll.be; dmarc=pass action=none header.from=ucll.be; dkim=pass header.d=ucll.be; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucll.be; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0xKhjE2AqHC9v+mrg8bk1mlx4XSATpRUEaUA/CgJmbY=; b=apd8HLcs4/7fkyv9syBBOsUYTVZ6RTzChcT748p81rqA4G/Y8CW+wsC3Gr7XUdu8RcJnmhTyTcvM7AHMQ1ZyX28MCSS9JnN84AX0J6UBRij7nCDecJuCQnZ0kWCG+8OaJk2ZnhcD+1xjvkCgIz3eS8MunUHIy/OWamNVxWNZdWo= Authentication-Results: lists.postgresql.org; dkim=none (message not signed) header.d=none;lists.postgresql.org; dmarc=none action=none header.from=ucll.be; Received: from AM0P195MB0324.EURP195.PROD.OUTLOOK.COM (2603:10a6:208:b3::30) by AM0P195MB0386.EURP195.PROD.OUTLOOK.COM (2603:10a6:208:b4::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.23; Fri, 17 Jul 2020 08:14:30 +0000 Received: from AM0P195MB0324.EURP195.PROD.OUTLOOK.COM ([fe80::55a3:c58a:1eb4:6d7e]) by AM0P195MB0324.EURP195.PROD.OUTLOOK.COM ([fe80::55a3:c58a:1eb4:6d7e%3]) with mapi id 15.20.3174.027; Fri, 17 Jul 2020 08:14:29 +0000 Message-ID: <7641998463cb4bfaff549426d6f81a3d3f96188b.camel@ucll.be> Subject: Re: Capturing just slow queries From: Wim Bertels Reply-To: wim.bertels@ucll.be To: pgsql-general@lists.postgresql.org Date: Fri, 17 Jul 2020 10:14:28 +0200 In-Reply-To: References: Organization: UC Leuven-Limburg Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AM4PR0302CA0007.eurprd03.prod.outlook.com (2603:10a6:205:2::20) To AM0P195MB0324.EURP195.PROD.OUTLOOK.COM (2603:10a6:208:b3::30) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from blauwbok (94.225.42.148) by AM4PR0302CA0007.eurprd03.prod.outlook.com (2603:10a6:205:2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.17 via Frontend Transport; Fri, 17 Jul 2020 08:14:29 +0000 X-Originating-IP: [94.225.42.148] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9da7e5cc-0553-4f6d-812f-08d82a296db4 X-MS-TrafficTypeDiagnostic: AM0P195MB0386: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yWpHFiqR+iQ2VTlzfRoKWpcDZMdHub6QerAIRoYJwgLrVJHsXn8yocFIszIAAhapmTofuwfxfB0wjUcfOsoyZ2bbDiAAlk3KxF7SeLvMDM5AJNAh2Fg2pxq0A2SWXRxEVoXN8U3pb2IMzvUcNsk7QmYjNzkHPrZGKCo4utF3fPCdvl6zRdEs2G3VHSoRtEwp3rV2sZXNXewV6YLcpAyqS5LGyz0fqflycJ5UmvJgcaL9pkGwdb0eQksdbbUbFbFBz84P5lvfV4sSysdcdury5dJsfICmutGu7qkpWhjb29QWEX5ApObGqc6J6w85M5xKsuP03MFq9hgiVZzvWyc7f/xr/dmURl6obsZBnQDh7BGbz9RAYi9/ZVddBIXRv2QFci4JGnp9r7WZI36jhyxoiQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0P195MB0324.EURP195.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(136003)(396003)(39850400004)(366004)(376002)(346002)(966005)(66556008)(5660300002)(6916009)(66476007)(3450700001)(6486002)(3480700007)(83380400001)(8676002)(786003)(16526019)(316002)(8936002)(26005)(36916002)(86362001)(52116002)(66946007)(6496006)(186003)(2616005)(44832011)(2906002)(956004)(4744005)(36756003)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: cHnq6LROdhSrnQVN9NkqE74Q4rD4eMumoDREFuCFAWjJZZhNVcxcKOOzSHK2UJOZo75F5Vi1G8kuLRPiFPVNS7pasLAGB9rF7ryq9RbrhPvdCF70qLXtxO8QWeiFsJ/Op7e9MkfS//pFOUMbu7+PkNeSYEMtEoMJHiebY6QMHoilas1jgqhIKxX5z2D6ROE7rGBAENxrjCeAUZjTI+kboqkA6gxx2yg5D6r97ay1mLq3FGaDRP+bl1p14zpthXQJPfzk/AwLHNRwOp1gjQtlI5R+fB+9TklZGuEknG7z5RJYdGFGfmbQ+mOfpybuD6+3bKTRIfdVr6zCSyPmZa8RNq6q/3kCHXBS9MpnKvhAOQuh2Z3IoNeCwZApl4R+y/5xahzeC/NqRKz6ZFHHfaJeCFq9SU/6j6rfFXKorMtb4MkD09G3QnrTeVDRFB5TGK1VnXoNFQxIwnJA2OHM5kVa5Q+UJM+DwIzd2h29bsJrwfs= X-OriginatorOrg: ucll.be X-MS-Exchange-CrossTenant-Network-Message-Id: 9da7e5cc-0553-4f6d-812f-08d82a296db4 X-MS-Exchange-CrossTenant-AuthSource: AM0P195MB0324.EURP195.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2020 08:14:29.7665 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e638861b-15d9-4de6-a65d-b48789ae1f08 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RLWFyxph9CYMp6SW6KLOSf6uxDFxVkYCW6M5XC3t/CpQ2NvWXbm8V0PArUP8a1q18UacdmURypH/3WwPmAocAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0P195MB0386 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk You might have a look at: https://www.postgresql.org/docs/current/auto-explain.html Also there are several monitoring solutions: https://wiki.postgresql.org/wiki/Monitoring Tiffany Thang schreef op do 16-07-2020 om 13:41 [-0400]: > Hi, > log_min_duration_statement captures all statements including DMLs > that have exceeded the threshold. Is there a way in PG 12 to capture > just select statements excluding all DMLs and DDLs? In my > environment, it's acceptable for DMLs and DDLs to cross the threshold > and we are more interested in capturing poor performing select > statements. > > Thanks. > > Tiff -- mvg, Wim Bertels -- Lector UC Leuven-Limburg -- There is no hunting like the hunting of man, and those who have hunted armed men long enough and liked it, never care for anything else thereafter. -- Ernest Hemingway