Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X4Dp0-0000Mg-RQ for pgsql-performance@arkaria.postgresql.org; Mon, 07 Jul 2014 18:39:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X4Dp0-00075A-AK for pgsql-performance@arkaria.postgresql.org; Mon, 07 Jul 2014 18:39:26 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X4Doy-00072n-Vy for pgsql-performance@postgresql.org; Mon, 07 Jul 2014 18:39:25 +0000 Received: from sam.nabble.com ([216.139.236.26]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1X4Dow-00009w-0K for pgsql-performance@postgresql.org; Mon, 07 Jul 2014 18:39:23 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1X4Dou-0007Kr-0f for pgsql-performance@postgresql.org; Mon, 07 Jul 2014 11:39:20 -0700 Date: Mon, 7 Jul 2014 11:39:20 -0700 (PDT) From: piuschan To: pgsql-performance@postgresql.org Message-ID: <1404758360012-5810779.post@n5.nabble.com> In-Reply-To: <19691.1404534696@sss.pgh.pa.us> References: <1404507888516-5810599.post@n5.nabble.com> <19691.1404534696@sss.pgh.pa.us> Subject: Re: stored procedure suddenly runs slowly in HOT STANDBY but fast in primary MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 1.9 (+) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Hi Tom, Thanks for your reply. As you said, the weirdest part is the the SP ran fine in primary server and hot standby server. I did another test over the weekend: (1) restore the production DB dump to an internal server with replication set up. (2) ran the SP in internal hot standy DB (3) surprisingly the SP ran fast in internal hot standby DB So what is the possible explanations to these test results? Is there a way to tell if the SP scans through all children event_startstop tables as you said? Thanks a lot, Pius -- View this message in context: http://postgresql.1045698.n5.nabble.com/stored-procedure-suddenly-runs-slowly-in-HOT-STANDBY-but-fast-in-primary-tp5810599p5810779.html Sent from the PostgreSQL - performance mailing list archive at Nabble.com. -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance