Re: pgsql: Add stats for min, max, mean, stddev times to pg_stat_statements - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Add stats for min, max, mean, stddev times to pg_stat_statements
Date
Msg-id 562.1427499563@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Add stats for min, max, mean, stddev times to pg_stat_statements  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: pgsql: Add stats for min, max, mean, stddev times to pg_stat_statements  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
Andrew Dunstan <andrew@dunslane.net> 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


pgsql-committers by date:

Previous
From: Petr Jelinek
Date:
Subject: Re: pgsql: Add stats for min, max, mean, stddev times to pg_stat_statements
Next
From: Peter Eisentraut
Date:
Subject: pgsql: Fix whitespace