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 1nfvLr-0005VA-73 for pgsql-performance@arkaria.postgresql.org; Sun, 17 Apr 2022 03:13:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nfvLo-0005yJ-Ge for pgsql-performance@arkaria.postgresql.org; Sun, 17 Apr 2022 03:13:24 +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 1nfvLo-0005y7-48 for pgsql-performance@lists.postgresql.org; Sun, 17 Apr 2022 03:13:24 +0000 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nfvLj-0003aD-KF for pgsql-performance@postgresql.org; Sun, 17 Apr 2022 03:13:23 +0000 Received: by mail-il1-x134.google.com with SMTP id f5so6818237ilj.13 for ; Sat, 16 Apr 2022 20:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=P7bZfnblzYniNHxc0SvAMTvUh6ycxgK9cZO10Pe70jY=; b=JB6zDPpHHpCg8oGaX5SlgQbI9NL8q21GmaQhw+C3nyOWdkjJoC87C4vE1Mf1kojlIK EBwUdU5i0ZnaVJKnwEuOqs7FOvAAavXFf0mvtjszxfwDjuXpaZZyTAemUECbujvMuaw5 twzMCvqaXEPhuMruHUFaS+58oIBWHsl+WzEvou/spe4Bf67T1QqRu2Dy7Tii2eVh99BI RvLt0/agF/h3edIxCRv0MOS6qitYC3HICSwcvZqNXeFLIbak6G2jgHmLsCbM+DpbSlLB 1zkXyMsyyQg7R4QARbKvLYLBONYSI0WojyCXuthw17sA5H/x10lW9AzEYLqNbiREEkEl /jcg== 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:user-agent; bh=P7bZfnblzYniNHxc0SvAMTvUh6ycxgK9cZO10Pe70jY=; b=vVi+P/1P6jkdPovTPPZXRP1ht/oSkIkbqAnTsml9UeBUmKUJxWQZy9aszqpLBx/gQq n6ZI1lgqcOSXEFkH2xS04+FSd3me/Pd8+718G08EwuVuTX21lyvnOf8oIPgfa0OGbh76 pjHAm2vPe/82N1bOW0kAb5Q9/PP6bHw2adFIzyfdWTWXDWU0C3+mF+88B7v91SDwnFf+ rPzRqbNuJRXZBAkpRoo4+ktLnBCTjosQyq9l8jOYSLZjWG/nP+kDox+uPzbFdyzd54Ks mrBt21y3tFhq/uA+CpTxdU11NXT5NeEOh/raL2ofWQWW90dWafuTgs/XoL6lsPPFYDcA 6X2A== X-Gm-Message-State: AOAM532Ia3RUJ6yVPbxybG0QTDSKs8e76igO86b6382uUZ3j76t/YHKe dKFssn6VQ/yeeWbQXHcg441Dfg== X-Google-Smtp-Source: ABdhPJxpcs8/7fD2Uwwz+euXQW5irOosNM25EhQQNNJDRup67p0HxHOm57Hzq+h2gTVEXLWqMGgwiQ== X-Received: by 2002:a05:6e02:1584:b0:2b9:7a3d:8937 with SMTP id m4-20020a056e02158400b002b97a3d8937mr2395076ilu.192.1650165197996; Sat, 16 Apr 2022 20:13:17 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id a5-20020a056e020e0500b002caca72891fsm5289393ilk.27.2022.04.16.20.13.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Apr 2022 20:13:17 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id D8207800CA7; Sat, 16 Apr 2022 22:13:15 -0500 (CDT) Date: Sat, 16 Apr 2022 22:13:15 -0500 From: Justin Pryzby To: "Kumar, Mukesh" Cc: pgsql-performance@postgresql.org, MUKESH KUMAR Subject: Re: Query Tunning related to function Message-ID: <20220417031315.GY26620@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, Apr 14, 2022 at 06:03:33AM +0000, Kumar, Mukesh wrote: > We are running the below query in PostgreSQL and its taking approx. 8 to 9 sec to run the query. > > Query - 1 ... > > The explain plan and other details are placed at below link for more information. We have checked the indexes on column but in the explain plan it is showing as Seq Scan which we have to find out. > > https://explain.depesz.com/s/Jsiw#stats There's a list of information to provide in the postgres wiki, and people here sent you a link to that wiki page on Feb 27, Mar 1, and Apr 12. Your problem report is still missing a lot of that information. Asking for it piece by piece would be tedious. -- Justin