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 1nXhLo-0001Lx-3r for pgsql-performance@arkaria.postgresql.org; Fri, 25 Mar 2022 10:39:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nXhLm-0006aS-KU for pgsql-performance@arkaria.postgresql.org; Fri, 25 Mar 2022 10:39:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXhLm-0006aJ-9e for pgsql-performance@lists.postgresql.org; Fri, 25 Mar 2022 10:39:22 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXhLj-0007vH-5Z for pgsql-performance@postgresql.org; Fri, 25 Mar 2022 10:39:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mEHOMNSvLH23sG6U+cUpWiKL3dvnOjoK1pyd1CJSxJY=; b=IQ+ll4HUmFmuG8jja9XIdBy+i9 6Tc/XxFk3DP3fsYcpKVNsUN9bepJVS1hmFacC+gCHCRy1vo9lPGGMB0X+19E6mZz4bmWiwIuxArMT aR8LEIZRPYaeLQP8ImYKXApED3whyQRQZdtpzOlshClY1nvWtWZMNXBRZl9Jrn10twcw=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1nXhLg-0008C7-3k; Fri, 25 Mar 2022 11:39:16 +0100 Date: Fri, 25 Mar 2022 11:39:15 +0100 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: "Kumar, Mukesh" Cc: "pgsql-performance@postgresql.org" Subject: Re: View taking time to show records Message-ID: <20220325103915.GA21555@depesz.com> Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Mar 24, 2022 at 03:59:54PM +0000, Kumar, Mukesh wrote: > Can anyone suggest to improve the query as from application end 1 min time is not accepted by client. > Please find the query and explain analyze report from below link It's hard to say for sure without seeing real query (query on view is nice, but we can't tell what is going on there, really) - we'd need to know definitions of all views and tables that are involved there. for starters, I'd suggest adding indexes: 1. on so_vendor_address_base (ap_vendor_id_lf || ap_vendor_suffix_lf) 2. on so_vendor_address_base (vendor_type_f) whether this will fix the problem, can't really tell. Also - you might want to join slack/irc to have a conversation about it - there are people in there who can help, and I think that conversation-style help will be better suited for this particular problem. Best regards, depesz