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 1nOIZV-0001M9-5C for pgsql-performance@arkaria.postgresql.org; Sun, 27 Feb 2022 12:22:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nOIZU-0005hO-1e for pgsql-performance@arkaria.postgresql.org; Sun, 27 Feb 2022 12:22:40 +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 1nOIZT-0005hF-Lf for pgsql-performance@lists.postgresql.org; Sun, 27 Feb 2022 12:22:39 +0000 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nOIZM-0000RH-Nq for pgsql-performance@postgresql.org; Sun, 27 Feb 2022 12:22:39 +0000 Received: by mail-pg1-x531.google.com with SMTP id o23so9059134pgk.13 for ; Sun, 27 Feb 2022 04:22:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=oi0n7SVzr7sBE6THi/kewLSKVRYx37X4cQsRd8Cz40g=; b=p7eM+e2oQ95BBTUd2Ql8U3PPZgItDO6IN138TXNPncxOU7Q5fNXDh75qRdqkM1PeZ8 c2yfUh7hsWacMhaupMV3IMLrljr5FxM69/FVY3n3Kyb5wUkopogokPF7k8EE+D/EMWlU IcTXkrOIKXtV65Q9/VJzGa2dTQoNwqs+82YwU80N6+uhF7hbAVVXWm7LBbkD4xC8D8xo FTHaVeS/ON5zz0F9e4Mhc+3aypmwP+VSNVt7BhgyzclHkuRUGYSNq8tRUnLysR3jX+Q0 8dVxaxXUY7jPjVLaaJBD8LnIAOyvw1PulSSQrEbu77biYGSB3dwdaHeiIwvNxyM4Howl olHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=oi0n7SVzr7sBE6THi/kewLSKVRYx37X4cQsRd8Cz40g=; b=3118bLA5/zQ7MW4HHrBo6vRMFrAhQ5kpTOYsXdF7e+gZeU9JbJo/WtFVNBVLkpU+qy SRBq0XWzwinSiq4WsgBFmJd/4emdkVuoeDTu5vKIEtnNKW5jt6VNNEanPGgqd2zn+b9t mBp+3SRBvKgLf/LUa7awFJhWVEXk9AMl1FOsNEoYfRIUZwsSDFuQk7ePjOCNnWAtY0em I0nus6rd6vUPjqAlZETqJqg9kOMWXDlEPmMKwqkIsWnShbn5bCrtaJ1pZ3zuYzHxgD9p 2UPsCWXUXfSz6NPdnuTVyh84pow2ng4RCqwsmqQ8o+iF2zCs7LmRYVdBnQLbZ76lqM0L 1Wng== X-Gm-Message-State: AOAM532xpM6wvLS4pxjy0YP66Sp+xXn3dkcQJhMeuAX/6oeq2iVGulBj LAkgAFSsRcAMUA6Swv8IaEM= X-Google-Smtp-Source: ABdhPJxCfjXt60rekpem+KKoStZSWu/HpiEW6JlGm5W8xz7jD5/U7xw2Zn7pSqh4IURxKQRzTy7IVw== X-Received: by 2002:a63:d40f:0:b0:372:a9ec:c027 with SMTP id a15-20020a63d40f000000b00372a9ecc027mr13398457pgh.360.1645964550513; Sun, 27 Feb 2022 04:22:30 -0800 (PST) Received: from jrouhaud (2001-b011-1005-1c63-7063-2c4c-07f7-08d0.dynamic-ip6.hinet.net. [2001:b011:1005:1c63:7063:2c4c:7f7:8d0]) by smtp.gmail.com with ESMTPSA id t27-20020aa7939b000000b004ce11b956absm9141066pfe.186.2022.02.27.04.22.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Feb 2022 04:22:30 -0800 (PST) Date: Sun, 27 Feb 2022 20:22:25 +0800 From: Julien Rouhaud To: "Kumar, Mukesh" Cc: "pgsql-performance@postgresql.org" Subject: Re: Never Ending query in PostgreSQL Message-ID: <20220227122225.xb2ex6frtst5aota@jrouhaud> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Sun, Feb 27, 2022 at 04:40:16AM +0000, Kumar, Mukesh wrote: > > Can you please help in tunning the attached query as , i am trying to run > this query and it runs for several hours and it did not give any output. > > I am not able to generate the explain analyze plan as well and it keeps on > running for several hours and did not give output. > > I have attached the query and explain plan without analyze. Please help if > nayone has any idea how to tune that query. You attached the explain plan in both files. Also even if there was the query there wouldn't be enough information to be able to help, please consult https://wiki.postgresql.org/wiki/Slow_Query_Questions to provide more details.