Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fKltc-0008ME-Kk for pgsql-performance@arkaria.postgresql.org; Mon, 21 May 2018 14:34:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fKltb-0007H5-Es for pgsql-performance@arkaria.postgresql.org; Mon, 21 May 2018 14:34:43 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fKltb-0007Gv-41 for pgsql-performance@lists.postgresql.org; Mon, 21 May 2018 14:34:43 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fKltU-0004vH-Cv for pgsql-performance@postgresql.org; Mon, 21 May 2018 14:34:41 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 6F19DD0E707D for ; Mon, 21 May 2018 07:34:35 -0700 (MST) Date: Mon, 21 May 2018 07:34:35 -0700 (MST) From: pavan95 To: pgsql-performance@postgresql.org Message-ID: <1526913275452-0.post@n3.nabble.com> In-Reply-To: <1526911926.12183.1@homie.mail.dreamhost.com> References: <1526883356469-0.post@n3.nabble.com> <1526889830358-0.post@n3.nabble.com> <1526901200599-0.post@n3.nabble.com> <1526902087.12183.0@homie.mail.dreamhost.com> <1526909995520-0.post@n3.nabble.com> <1526911926.12183.1@homie.mail.dreamhost.com> Subject: Re: Help me in reducing the CPU cost for the high cost query below, as it is hitting production seriously!! MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi abbas, Thank you so much. I've got this query from my development team asking to improve its performance. Now I got pretty much clear idea of it. And it will be the final extent to which we can tune the performance right? If there is still a way give me some tips to enhance the query performance. But kudos for your "floor" function. After a long struggle with the indexes, joins and the hints I came to know that there is also a way to tune the query performance by rewriting the query. Thanks in advance. Regards, Pavan -- Sent from: http://www.postgresql-archive.org/PostgreSQL-performance-f2050081.html