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 1m6zkl-0006n9-T9 for pgsql-performance@arkaria.postgresql.org; Fri, 23 Jul 2021 18:18:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m6zkj-0007cf-1C for pgsql-performance@arkaria.postgresql.org; Fri, 23 Jul 2021 18:18:29 +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 1m6zki-0007cO-Kt for pgsql-performance@lists.postgresql.org; Fri, 23 Jul 2021 18:18:28 +0000 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m6zkb-0004xN-Vv for pgsql-performance@postgresql.org; Fri, 23 Jul 2021 18:18:28 +0000 Received: by mail-io1-xd31.google.com with SMTP id f11so3645890ioj.3 for ; Fri, 23 Jul 2021 11:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=PCjB6usa/+2K9PfiiM0a+JNpeo/I9M98ckKWsp+91a0=; b=FB9mjr4jXh8iYp9fj9Xqi87lUw24VQFX7rULj4oGyNDLoEZOm3iVBb0JyGRQ077Iet Owj2RfuQtUL8SDH/I85o0XSb4y35XXLv00Nm4YZ1oUz745Tiy3yTP2qRIwQt1XCn5AUK 89ccxSYVQclnwXNKG3GDpSXVzD0W2kBLU/kEdB78ZCaXl8f5j6ZGPRNGPX2Gd9Fcq8cE p2A924IBcROrPZoNKpRdO+tC8UmbE5gz65TbAkHfaHXk3kdYrFA/krQ/0dIF++aDVnRN 19AUb6M9uu5KTPbk9SDnFbWGCqDeYF638178z2lOaIBfuq2N2gU1XKscDyWclyT+Tojc k3sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=PCjB6usa/+2K9PfiiM0a+JNpeo/I9M98ckKWsp+91a0=; b=bvK9nbJF3n4djERCTpmOnxtdFxgkqoFtKCgzW4HczH/fQbFoY71RBCfteWOUJN/4qU 7VtBORHtJLvP7w0e7FO3iQcjMDj5v2Oa3DNrEBMgtLHiNlwtefR/wg7Sxq1P/IUN8ulc TR6lNYwScekNVw1rZQXQX6aXgpMZAU3AJp4szMvl3VfmVWkVJ0jb39h1tSUYZIeBtc6J wjVPLalEC+k192/ZJkdorGTCEbnVE26TH6MdsqW6aP4D45i/RCqWx3h5a8mi7Bcq7CW9 h7D8QJdejg4m+ERL13kff1a4uz1m+AhZhhhW2p/owOGnWJnhaa8zRe3T5zfcfKNGVFJH Ryjg== X-Gm-Message-State: AOAM530T0X2PhSXk32hcUBkkSiQQBaabGNzmL9B1U7Klc7NyRHaHp/Fl t8yegV4DYaSNuqujKbtyzm8tLeK2O7WY8A== X-Google-Smtp-Source: ABdhPJwPOuc+caIbg7p/+b2TInNIQNQ7sHr3pUR1JK+2aursNmbdjUQjCsp2rHl+rKR9OHtftpT/IQ== X-Received: by 2002:a02:93a7:: with SMTP id z36mr5076436jah.112.1627064299382; Fri, 23 Jul 2021 11:18:19 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id u15sm19306237ion.34.2021.07.23.11.18.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jul 2021 11:18:18 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id E0546800B38; Fri, 23 Jul 2021 13:18:17 -0500 (CDT) Date: Fri, 23 Jul 2021 13:18:17 -0500 From: Justin Pryzby To: Manoj Kumar Cc: pgsql-performance@postgresql.org, "A.S. Fazlu Rahman" Subject: Re: Performance Issue on a table Message-ID: <20210723181817.GP19620@telsasoft.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jul 22, 2021 at 01:54:25PM +0000, Manoj Kumar wrote: > Recently we have noticed that in one of our DB instances there is a potential delay in querying a table from java code. could you please check the attached log and help understand what is the problem and which direction should be look into solving this delay of 4 odd mins ? I'm not familiar with the log, but it looks like the delay is in query parsing (ParseComplete). Which seems weird. You might try running wireshark to verify that. Or check postgres logs, and make sure the query isn't being blocked by DDL commands. Make sure these are enabled: log_lock_waits = 'on' deadlock_timeout = '1s' > 4:25:00 PM ... execute FINEST: simple execute, handler=org.postgresql.jdbc.PgStatement$StatementResultHandler@13e344d, maxRows=0, fetchSize=0, flags=1 > 4:25:00 PM ... sendSimpleQuery FINEST: FE=> SimpleQuery(query="SAVEPOINT PGJDBC_AUTOSAVE") > 4:25:00 PM ... sendParse FINEST: FE=> Parse(stmt=null,query="SELECT RECID FROM TAFJ_HASHLOCKS WHERE RECID = $1 FOR UPDATE NOWAIT ",oids={1043}) > 4:25:00 PM ... sendBind FINEST: FE=> Bind(stmt=null,portal=null,$1=<'256292129'>,type=VARCHAR) > 4:25:00 PM ... sendDescribePortal FINEST: FE=> Describe(portal=null) > 4:25:00 PM ... sendExecute FINEST: FE=> Execute(portal=null,limit=0) > 4:25:00 PM ... sendSync FINEST: FE=> Sync > 4:25:00 PM ... receiveCommandStatus FINEST: <=BE CommandStatus(RELEASE) > 4:25:00 PM ... receiveRFQ FINEST: <=BE ReadyForQuery(T) > 4:25:00 PM ... receiveCommandStatus FINEST: <=BE CommandStatus(SAVEPOINT) > 4:25:00 PM ... receiveRFQ FINEST: <=BE ReadyForQuery(T) > 4:29:20 PM ... processResults FINEST: <=BE ParseComplete [null] > 4:29:20 PM ... processResults FINEST: <=BE BindComplete [unnamed] > 4:29:20 PM ... receiveFields FINEST: <=BE RowDescription(1)