Re: pgsql: Add stats for min, max, mean, stddev times to pg_stat_statements

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Add stats for min, max, mean, stddev times to pg_stat_statements
Date: 2015-03-27 23:39:23
Message-ID: 562.1427499563@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Andrew Dunstan <andrew(at)dunslane(dot)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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2015-03-27 23:51:15 pgsql: Fix whitespace
Previous Message Petr Jelinek 2015-03-27 23:07:18 Re: pgsql: Add stats for min, max, mean, stddev times to pg_stat_statements