Re: Hash id in pg_stat_statements

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Peter Geoghegan <peter(at)2ndquadrant(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Hash id in pg_stat_statements
Date: 2012-10-02 21:09:02
Message-ID: 20121002210902.GC11163@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 02, 2012 at 12:58:15PM -0400, Stephen Frost wrote:
> > I simply do not understand objections to the proposal. Have I missed something?
>
> It was my impression that the concern is the stability of the hash value
> and ensuring that tools which operate on it don't mistakenly lump two
> different queries into one because they had the same hash value (caused
> by a change in our hashing algorithm or input into it over time, eg a
> point release). I was hoping to address that to allow this proposal to
> move forward..

That makes no sense though. The moment you talk about "hash" you
consider the possibility of lumping together things that aren't the
same. Any tools using these hashes must have realised this.

Fortunatly, the statistics are better than the birthday paradox. The
chances that the two most important queries in your system end up
having the same hash is miniscule.

Like mentioned elsewhere, a system with more than 10,000 different
queries sounds rare to me (once you exclude query parameters ofcourse).

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> He who writes carelessly confesses thereby at the very outset that he does
> not attach much importance to his own thoughts.
-- Arthur Schopenhauer

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabrízio de Royes Mello 2012-10-02 22:33:17 Re: CREATE SCHEMA IF NOT EXISTS
Previous Message Alvaro Herrera 2012-10-02 20:38:20 Re: CREATE SCHEMA IF NOT EXISTS