Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ybdqh-00040v-Sr for pgsql-committers@arkaria.postgresql.org; Fri, 27 Mar 2015 23:39:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Ybdqg-00073L-Fl for pgsql-committers@arkaria.postgresql.org; Fri, 27 Mar 2015 23:39:34 +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 1Ybdqe-000738-9q for pgsql-committers@postgresql.org; Fri, 27 Mar 2015 23:39:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YbdqX-0005Cw-0V for pgsql-committers@postgresql.org; Fri, 27 Mar 2015 23:39:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t2RNdN7M000563; Fri, 27 Mar 2015 19:39:23 -0400 From: Tom Lane To: Andrew Dunstan cc: pgsql-committers@postgresql.org Subject: Re: pgsql: Add stats for min, max, mean, stddev times to pg_stat_statements In-reply-to: <5515D932.8020305@dunslane.net> References: <26457.1427493201@sss.pgh.pa.us> <5515D932.8020305@dunslane.net> Comments: In-reply-to Andrew Dunstan message dated "Fri, 27 Mar 2015 18:26:58 -0400" Date: Fri, 27 Mar 2015 19:39:23 -0400 Message-ID: <562.1427499563@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org Andrew Dunstan writes: > However, it is moaning about the code in the sqrtd() function. I'm > wondering if we shouldn't just rip that out and use the library sqrt() > function. It's not called for every statement processed, only each time > the function is called (for each row). [ looks... ] +1. I'm skeptical that that's even a win at all on modern hardware; sqrt() is a primitive operation on nearly anything these days. Also, quite aside from the error of supposing that long long int is the same size as double, I'm pretty sure this would fail miserably on non-IEEE-float hardware; and it may well have endianness issues too. Since the code isn't actually being executed on the buildfarm, only compiled, we have no good way to tell whether it would produce sane results everywhere. regards, tom lane -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers