Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d6HFB-0004Nt-Q5 for pgsql-hackers@arkaria.postgresql.org; Thu, 04 May 2017 13:56:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d6HFA-00026E-QT for pgsql-hackers@arkaria.postgresql.org; Thu, 04 May 2017 13:56:32 +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.84_2) (envelope-from ) id 1d6HDc-00054C-IY for pgsql-hackers@postgresql.org; Thu, 04 May 2017 13:54:56 +0000 Received: from mail-qt0-x22d.google.com ([2607:f8b0:400d:c0d::22d]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d6HDZ-0000dj-KT for pgsql-hackers@postgresql.org; Thu, 04 May 2017 13:54:55 +0000 Received: by mail-qt0-x22d.google.com with SMTP id m36so10554921qtb.0 for ; Thu, 04 May 2017 06:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=ja8gb+pCtRzgJLfMa/iu4kPCkm3B2WQOo9fLn5Q+RFY=; b=0t9S5xt27pe4L2oYhZRWh4O0LFllCHTnSSQN/UOZ1EZvx9gBfg7WlEID71tIgw9RT6 YgeF3Pk1GjzxgfOa73v6ozsy//JlZT6UAKV5avW0zd6WFZmgAjDwTJ/Ld7OCu0PPrarY qv34S02symijJEpFofGJG0+S9gci7cSwtGy+fSh03tMZMcJ280KCu4vYZL4+8RuboXkd z+grRyWxG+WRxe7TeyvEDbhpRBz+hROd3SSEkTxcBdrHFoGTJeuSVyjwvdMyl1V3Cpwi CrfU5Owt8SyQZR58Gktbbuv93XgHEOGVAaLe60bpxX4s5HcExz809txq/HHSRhB2RE7x F6lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=ja8gb+pCtRzgJLfMa/iu4kPCkm3B2WQOo9fLn5Q+RFY=; b=eCx9V0VGHi1hr3FDg2ozxJA6pBjfJohHChUWyAeP7FFRHj3GuidR1sBDgHhgEgAoTo sY3+a2MV7xMMJd7Z5JT/Ym8EAdkBHn67cXbre7yGxKAPEvR0ezElq1zHBwJT83Xi13O2 Rj5vyq+Ho6v/e07Yv77V8qIcTZFdPNdjm6KGaKthGLsVwMkWWrU3IGMQvces6VHMgZrc p0jk4YF0JQolumV8Th6VZSCTa+QCHSJsqViY4dI8l7lV8c0ygjGsTNiQ5G1NHXajnHfd VDqVc+X4pGtl/mN3YZhHJeXEjGJtf6+LOcv62MTfRTz1TtW6RVHe0WSPWp2dKW5Toror BAOA== X-Gm-Message-State: AN3rC/5nKF/4m+z/WG/fLqRUSxwLRGLS4r9dYH9cp70Bec3OHylp3hur p6qYPaAY3na3HL3YR4TPg2UWx6nPWEd+g1jwCHtyrvw4yerNQttVVDvEyzgYHgpDbS9u8vZ/it3 x5bHN/RkUk5KhMsjNd+jAIxkQkZNGC9X62UbK+1Bbm5gRA0S59r9meF84qslss208inO/qg== X-Received: by 10.200.52.83 with SMTP id v19mr10714532qtb.214.1493906091734; Thu, 04 May 2017 06:54:51 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([179.57.115.10]) by smtp.gmail.com with ESMTPSA id t68sm1389465qkc.44.2017.05.04.06.54.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 May 2017 06:54:51 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 15219586; Thu, 4 May 2017 10:54:49 -0300 (-03) Date: Thu, 4 May 2017 10:54:49 -0300 From: Alvaro Herrera To: Tom Lane Cc: pgsql-hackers@postgreSQL.org Subject: Re: Reducing runtime of stats regression test Message-ID: <20170504135449.zepyxepq6ug5pgim@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <17795.1493869423@sss.pgh.pa.us> User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Tom Lane wrote: > The other significant delay in stats.sql is > > -- force the rate-limiting logic in pgstat_report_stat() to time out > -- and send a message > SELECT pg_sleep(1.0); > > Now, we do seem to need a delay there, because the rate-limiting logic > is unlikely to have permitted the count from the immediately preceding > statement to have gotten sent right then, and the count won't get > sent at all while we're inside wait_for_stats (since backends only > send stats just before going idle). But there's more than one way > to skin this cat. We can just start a new connection with \c, and > let wait_for_stats wait for the old one to send its stats before quitting. > Even on my oldest and slowest buildfarm machines, starting a new session > takes well under one second. So you changed table prevstats from temp to permanent; perhaps make it unlogged? I wonder if it'd be useful to have a "pg_stat_flush" or something, which sends out whatever is queued in this session. Then you wouldn't need the reconnection. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers