Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-12-08 Thread Peter Eisentraut
On Sat, 2013-12-07 at 16:00 -0800, Peter Geoghegan wrote: > On Sat, Dec 7, 2013 at 3:50 PM, Peter Eisentraut wrote: > > 32-bit buildfarm members are having problems with this patch. > > This should fix that problem. Thanks. This is incidentally the same problem that was reported here about anoth

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-12-08 Thread Magnus Hagander
On Sun, Dec 8, 2013 at 1:00 AM, Peter Geoghegan wrote: > On Sat, Dec 7, 2013 at 3:50 PM, Peter Eisentraut wrote: > > 32-bit buildfarm members are having problems with this patch. > > This should fix that problem. Thanks. > Applied. I also noted on http://buildfarm.postgresql.org/cgi-bin/show_s

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-12-07 Thread Peter Geoghegan
On Sat, Dec 7, 2013 at 3:50 PM, Peter Eisentraut wrote: > 32-bit buildfarm members are having problems with this patch. This should fix that problem. Thanks. -- Peter Geoghegan diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c new fi

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-12-07 Thread Peter Eisentraut
On Sun, 2013-12-08 at 02:08 +0900, Fujii Masao wrote: > > Attached revision displays signed 64-bit integers instead. > > Thanks! Looks good to me. Committed! 32-bit buildfarm members are having problems with this patch. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-12-07 Thread Fujii Masao
On Sat, Dec 7, 2013 at 6:31 AM, Peter Geoghegan wrote: > On Fri, Dec 6, 2013 at 12:24 PM, Tom Lane wrote: >>> There seems to be no problem even if we use bigint as the type of >>> unsigned 32-bit integer like queryid. For example, txid_current() >>> returns the transaction ID, i.e., unsigned 32-b

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-12-06 Thread Peter Geoghegan
On Fri, Dec 6, 2013 at 12:24 PM, Tom Lane wrote: >> There seems to be no problem even if we use bigint as the type of >> unsigned 32-bit integer like queryid. For example, txid_current() >> returns the transaction ID, i.e., unsigned 32-bit integer, as bigint. >> Could you tell me what the problem

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-12-06 Thread Tom Lane
Fujii Masao writes: > On Sun, Nov 24, 2013 at 10:58 AM, Peter Geoghegan wrote: >> I decided that queryid should be of type oid, not bigint. This is >> arguably a slight abuse of notation, but since ultimately Oids are >> just abstract object identifiers (so say the docs), but also because >> ther

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-12-06 Thread Fujii Masao
On Sun, Nov 24, 2013 at 10:58 AM, Peter Geoghegan wrote: > On Mon, Nov 18, 2013 at 1:54 AM, Sameer Thakur wrote: >> Please find v10 of patch attached. This patch addresses following >> review comments > > I've cleaned this up - revision attached - and marked it "ready for > committer". > > I dec

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-12-04 Thread Sameer Thakur
> >I've cleaned this up - revision attached - and marked it "ready for > committer". > Thank you for this. > I did the basic hygiene test. The patch applies correctly and compiles with no warnings. Did not find anything broken in basic functionality. In the documentation i have a minor suggesti

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-11-23 Thread Peter Geoghegan
On Mon, Nov 18, 2013 at 1:54 AM, Sameer Thakur wrote: > Please find v10 of patch attached. This patch addresses following > review comments I've cleaned this up - revision attached - and marked it "ready for committer". I decided that queryid should be of type oid, not bigint. This is arguably a

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-11-18 Thread Sameer Thakur
Hello, Please find v10 of patch attached. This patch addresses following review comments 1. Removed errcode and used elogs for error "pg_stat_statements schema is not supported by its binary" 2. Removed comments and other code formatting not directly relevant to patch functionality 3. changed posit

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-11-14 Thread Sameer Thakur
> I took a quick look. Observations: > > + /* Making query ID dependent on PG version */ > + query->queryId |= PG_VERSION_NUM << 16; > > If you want to do something like this, make the value of > PGSS_FILE_HEADER incorporate (PG_VERSION_NUM / 100) or something. > > Why are you doing this? The thou

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-11-14 Thread Daniel Farina
On Thu, Nov 14, 2013 at 7:25 PM, Peter Geoghegan wrote: > On Tue, Nov 5, 2013 at 5:30 AM, Sameer Thakur wrote: >> Hello, >> Please find attached pg_stat_statements-identification-v9.patch. > > I took a quick look. Observations: > > + /* Making query ID dependent on PG version */ > + q

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-11-14 Thread Peter Geoghegan
On Tue, Nov 5, 2013 at 5:30 AM, Sameer Thakur wrote: > Hello, > Please find attached pg_stat_statements-identification-v9.patch. I took a quick look. Observations: + /* Making query ID dependent on PG version */ + query->queryId |= PG_VERSION_NUM << 16; If you want to do something l

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-11-05 Thread Sameer Thakur
Hello, Please find attached pg_stat_statements-identification-v9.patch. I have tried to address the following review comments 1. Use version PGSS_TUP_V1_2 2.Fixed total time being zero 3. Remove 'session_start' from the view and use point release number to generate queryid 4. Hide only queryid and

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-11 Thread Sameer Thakur
> This paragraph reads a bit strange to me: > > + A statistics session is the time period when statistics are gathered by > statistics collector > + without being reset. So a statistics session continues across normal > shutdowns, > + but whenever statistics are reset, like during a crash or upg

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-11 Thread Peter Eisentraut
On 10/10/13 6:20 AM, Sameer Thakur wrote: > Please find patch attached which adds documentation for session_start > and introduced fields and corrects documentation for queryid to be > query_id. session_start remains in the view as agreed. Please fix the tabs in the SGML files. -- Sent via pg

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-10 Thread Daniel Farina
On Thu, Oct 10, 2013 at 1:30 PM, Alvaro Herrera wrote: >> > Just noticed that you changed the timer to struct Instrumentation. Not >> > really sure about that change. Since you seem to be using only the >> > start time and counter, wouldn't it be better to store only those? >> > Particularly uns

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-10 Thread pilum . 70
The V7-Patch applied cleanly and I got no issues in my first tests. The change from column session_start to a function seems very reasonable for me. Concernig the usability, I would like to suggest a minor change, that massively increases the usefulness of the patch for beginners, who often us

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-10 Thread Alvaro Herrera
Daniel Farina escribió: > Given that, perhaps a way to fix this is something like this patch-fragment: > > """ > { > PGSS_TUP_V1_0 = 1, > PGSS_TUP_V1_1, > - PGSS_TUP_LATEST > + PGSS_TUP_V1_2 > } pgssTupVersion; > > +#define PGSS_TUP_LATEST PGSS_TUP_V1_2 > """ This sounds good. I have see

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-10 Thread Daniel Farina
On Thu, Oct 10, 2013 at 10:49 AM, Alvaro Herrera wrote: > Daniel Farina escribió: >> On Thu, Oct 10, 2013 at 7:40 AM, Fujii Masao wrote: > >> > In my test, I found that pg_stat_statements.total_time always indicates a >> > zero. >> > I guess that the patch might handle pg_stat_statements.total_t

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-10 Thread Daniel Farina
On Thu, Oct 10, 2013 at 10:12 AM, Fujii Masao wrote: > On Fri, Oct 11, 2013 at 12:19 AM, Daniel Farina wrote: >> Probably. >> >> The idea is that without those fields it's, to wit, impossible to >> explain non-monotonic movement in metrics of those queries for precise >> use in tools that insist

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-10 Thread Fujii Masao
On Fri, Oct 11, 2013 at 2:49 AM, Alvaro Herrera wrote: > Daniel Farina escribió: >> On Thu, Oct 10, 2013 at 7:40 AM, Fujii Masao wrote: > >> > In my test, I found that pg_stat_statements.total_time always indicates a >> > zero. >> > I guess that the patch might handle pg_stat_statements.total_ti

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-10 Thread Alvaro Herrera
Daniel Farina escribió: > On Thu, Oct 10, 2013 at 7:40 AM, Fujii Masao wrote: > > In my test, I found that pg_stat_statements.total_time always indicates a > > zero. > > I guess that the patch might handle pg_stat_statements.total_time wrongly. > > > > +values[i++] = DatumGetTimestamp( >

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-10 Thread Fujii Masao
On Fri, Oct 11, 2013 at 12:19 AM, Daniel Farina wrote: > Probably. > > The idea is that without those fields it's, to wit, impossible to > explain non-monotonic movement in metrics of those queries for precise > use in tools that insist on monotonicity of the fields, which are all > cumulative to

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-10 Thread Daniel Farina
On Thu, Oct 10, 2013 at 7:40 AM, Fujii Masao wrote: > On Thu, Oct 10, 2013 at 7:20 PM, Sameer Thakur wrote: >> Please find patch attached which adds documentation for session_start >> and introduced fields and corrects documentation for queryid to be >> query_id. session_start remains in the view

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-10 Thread Fujii Masao
On Thu, Oct 10, 2013 at 7:20 PM, Sameer Thakur wrote: > Please find patch attached which adds documentation for session_start > and introduced fields and corrects documentation for queryid to be > query_id. session_start remains in the view as agreed. Thanks for updating the document! I'm not cl

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-10 Thread pilum . 70
Thx for your reply. On Thu, 10 Oct 2013, Peter Geoghegan wrote: On Thu, Oct 10, 2013 at 3:11 AM, wrote: But the drawback of this approach is impossibility to use explain analyze without further substitutions. You can fairly easily disable the swapping of constants with '?' symbols, so that

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-10 Thread Peter Geoghegan
On Thu, Oct 10, 2013 at 3:11 AM, wrote: > But the drawback of this approach is impossibility to use > explain analyze without further substitutions. You can fairly easily disable the swapping of constants with '?' symbols, so that the query text stored would match the full originally executed qu

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-10 Thread Sameer Thakur
Please find patch attached which adds documentation for session_start and introduced fields and corrects documentation for queryid to be query_id. session_start remains in the view as agreed. regards Sameer pg_stat_statements-identification-v8.patch.gz Description: GNU Zip compressed data -- Se

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-10 Thread pilum . 70
The V7-Patch applied cleanly and I got no issues in my first tests. The change from column session_start to a function seems very reasonable for me. Concernig the usability, I would like to suggest a minor change, that massively increases the usefulness of the patch for beginners, who often u

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-05 Thread Sameer Thakur
On Sat, Oct 5, 2013 at 1:38 PM, Daniel Farina wrote: > On Fri, Oct 4, 2013 at 7:22 AM, Fujii Masao wrote: >> On Thu, Oct 3, 2013 at 5:11 PM, Sameer Thakur wrote: >>> On Wed, Oct 2, 2013 at 6:40 PM, Sameer Thakur wrote: > > Looks pretty good. Do you want to package up the patch with your

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-05 Thread Sameer Thakur
>> Please find the patch attached > > Thanks for the patch! Here are the review comments: > > +OUT session_start timestamptz, > +OUT introduced timestamptz, > > The patch exposes these columns in pg_stat_statements view. > These should be documented. Yes, will add to documentation. > I don

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-05 Thread Daniel Farina
On Fri, Oct 4, 2013 at 7:22 AM, Fujii Masao wrote: > On Thu, Oct 3, 2013 at 5:11 PM, Sameer Thakur wrote: >> On Wed, Oct 2, 2013 at 6:40 PM, Sameer Thakur wrote: Looks pretty good. Do you want to package up the patch with your change and do the honors and re-submit it? Thanks for

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-04 Thread Fujii Masao
On Thu, Oct 3, 2013 at 5:11 PM, Sameer Thakur wrote: > On Wed, Oct 2, 2013 at 6:40 PM, Sameer Thakur wrote: >>> >>> Looks pretty good. Do you want to package up the patch with your >>> change and do the honors and re-submit it? Thanks for helping out so >>> much! >> Sure, will do. Need to add a b

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-03 Thread Sameer Thakur
On Wed, Oct 2, 2013 at 6:40 PM, Sameer Thakur wrote: >> >> Looks pretty good. Do you want to package up the patch with your >> change and do the honors and re-submit it? Thanks for helping out so >> much! > Sure, will do. Need to add a bit of documentation explaining > statistics session as well.

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-02 Thread Sameer Thakur
> > Looks pretty good. Do you want to package up the patch with your > change and do the honors and re-submit it? Thanks for helping out so > much! Sure, will do. Need to add a bit of documentation explaining statistics session as well. I did some more basic testing around pg_stat_statements.max, n

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-01 Thread Peter Geoghegan
On Sun, Sep 29, 2013 at 10:58 PM, Daniel Farina wrote: > I remember hacking that out for testing sake. > > I can only justify it as a foot-gun to prevent someone from being > stuck restarting the database to get a reasonable number in there. > Let's CC Peter; maybe he can remember some thoughts ab

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-01 Thread Daniel Farina
On Tue, Oct 1, 2013 at 5:32 AM, Sameer Thakur wrote: > On Tue, Oct 1, 2013 at 12:48 AM, Daniel Farina-5 [via PostgreSQL] > <[hidden email]> wrote: > >> >> On Sep 30, 2013 4:39 AM, "Sameer Thakur" <[hidden email]> wrote: >>> >>> > Also, for onlookers, I have changed this patch around to do the >>>

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-01 Thread Sameer Thakur
On Tue, Oct 1, 2013 at 12:48 AM, Daniel Farina-5 [via PostgreSQL] wrote: > > On Sep 30, 2013 4:39 AM, "Sameer Thakur" <[hidden email]> wrote: >> >> > Also, for onlookers, I have changed this patch around to do the >> > date-oriented stuff but want to look it over before stapling it up and >> > sen

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-10-01 Thread Sameer Thakur
On Tue, Oct 1, 2013 at 12:48 AM, Daniel Farina-5 [via PostgreSQL] wrote: > > On Sep 30, 2013 4:39 AM, "Sameer Thakur" <[hidden email]> wrote: >> >> > Also, for onlookers, I have changed this patch around to do the >> > date-oriented stuff but want to look it over before stapling it up and >> > sen

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-30 Thread Daniel Farina
On Sep 30, 2013 4:39 AM, "Sameer Thakur" wrote: > > > Also, for onlookers, I have changed this patch around to do the > > date-oriented stuff but want to look it over before stapling it up and > > sending it. If one cannot wait, one can look at > > https://github.com/fdr/postgres/tree/queryid. T

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-30 Thread Sameer Thakur
> Also, for onlookers, I have changed this patch around to do the > date-oriented stuff but want to look it over before stapling it up and > sending it. If one cannot wait, one can look at > https://github.com/fdr/postgres/tree/queryid. The squashed-version of > that history contains a reasonable

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-29 Thread Daniel Farina
On Sun, Sep 29, 2013 at 10:25 AM, Sameer Thakur wrote: > Yes i was. Just saw a warning when pg_stat_statements is loaded that > valid values for pg_stat_statements.max is between 100 and 2147483647. > Not sure why though. I remember hacking that out for testing sake. I can only justify it as a f

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-29 Thread Sameer Thakur
On Mon, Sep 23, 2013 at 1:26 PM, samthakur74 wrote: >> >> I forgot about removal of the relevant SGML, amended here in v6. > > Thank you for this! > i did a quick test with following steps: > 1. Applied v6 patch > 2. make and make install on pg_stat_statements; > 3. Restarted Postgres with pg_stat

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-23 Thread Alvaro Herrera
Daniel Farina escribió: > On Fri, Sep 20, 2013 at 1:11 AM, Daniel Farina wrote: > > I think the n-call underestimation propagation may not be quite precise for > > various detailed reasons (having to do with 'sticky' queries) and to make it > > precise is probably more work than it's worth. And,

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-23 Thread samthakur74
> > I forgot about removal of the relevant SGML, amended here in v6. Thank you for this! i did a quick test with following steps: 1. Applied v6 patch 2. make and make install on pg_stat_statements; 3. Restarted Postgres with pg_stat_statements loaded with pg_stat_statements.max = 4 4. Dropped and

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-20 Thread Daniel Farina
On Fri, Sep 20, 2013 at 1:11 AM, Daniel Farina wrote: > I think the n-call underestimation propagation may not be quite precise for > various detailed reasons (having to do with 'sticky' queries) and to make it > precise is probably more work than it's worth. And, on more reflection, I'm > also h

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-19 Thread samthakur74
On Thu, Sep 19, 2013 at 11:32 AM, Fujii Masao-2 [via PostgreSQL] < ml-node+s1045698n5771565...@n5.nabble.com> wrote: > On Thu, Sep 19, 2013 at 2:25 PM, samthakur74 <[hidden > email]> > wrote: > > >>I got the segmentation fault when I tested th

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-18 Thread Fujii Masao
On Thu, Sep 19, 2013 at 2:25 PM, samthakur74 wrote: >>I got the segmentation fault when I tested the case where the >> least-executed >>query statistics is discarded, i.e., when I executed different queries more >> than >>pg_stat_statements.max times. I guess that the patch might have a bug. > Tha

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-18 Thread samthakur74
>I got the segmentation fault when I tested the case where the least-executed >query statistics is discarded, i.e., when I executed different queries more than >pg_stat_statements.max times. I guess that the patch might have a bug. Thanks, will try to fix it. >pg_stat_statements--1.1.sql should be

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-18 Thread Fujii Masao
On Thu, Sep 19, 2013 at 2:41 AM, Fujii Masao wrote: > On Wed, Sep 18, 2013 at 2:41 PM, Sameer Thakur wrote: >You seem to have forgotten to include the pg_stat_statements--1.2.sql >and pg_stat_statements--1.1--1.2.sql in the patch. Sorry again. Please find updated patch attached. >>

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-18 Thread Fujii Masao
On Wed, Sep 18, 2013 at 2:41 PM, Sameer Thakur wrote: >>> >You seem to have forgotten to include the pg_stat_statements--1.2.sql >>> >and pg_stat_statements--1.1--1.2.sql in the patch. >>> Sorry again. Please find updated patch attached. > > I did not add pg_stat_statements--1.2.sql. I have added

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-17 Thread Sameer Thakur
>> >You seem to have forgotten to include the pg_stat_statements--1.2.sql >> >and pg_stat_statements--1.1--1.2.sql in the patch. >> Sorry again. Please find updated patch attached. I did not add pg_stat_statements--1.2.sql. I have added that now and updated the patch again. The patch attached sho

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-17 Thread Fujii Masao
On Tue, Sep 17, 2013 at 10:48 PM, samthakur74 wrote: > > > > > >You seem to have forgotten to include the pg_stat_statements--1.2.sql > >and pg_stat_statements--1.1--1.2.sql in the patch. >> >> >> Sorry again. Please find updated patch attached. pg_stat_statements--1.2.sql is missing. Could you c

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-17 Thread samthakur74
>You seem to have forgotten to include the pg_stat_statements--1.2.sql >and pg_stat_statements--1.1--1.2.sql in the patch. > > Sorry again. Please find updated patch attached. > > > > NAML

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-17 Thread Fujii Masao
On Sun, Sep 15, 2013 at 3:54 PM, samthakur74 wrote: > > >> >You have added this email to the commit fest, but it contains no patch. >> >> >Please add the email with the actual patch. > > I hope its attached now! You seem to have forgotten to include the pg_stat_statements--1.2.sql and pg_stat_st

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-14 Thread samthakur74
> >You have added this email to the commit fest, but it contains no patch. > >Please add the email with the actual patch. > I hope its attached now! > Maybe the author should be > >given a chance to update the patches, though, because they are quite > >old. > I did connect with Daniel and he di

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-14 Thread Peter Eisentraut
On Sat, 2013-09-14 at 03:51 -0700, samthakur74 wrote: > We have a need to see this patch committed hence the revived interest > in this thread You have added this email to the commit fest, but it contains no patch. Please add the email with the actual patch. Maybe the author should be given a ch

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-09-14 Thread samthakur74
>This patch needs documentation. At a minimum, the new calls_underest >field needs to be listed in the description of the pg_stat_statements. I have attached a version which includes documentation. pg_stat_statements-identification-v4.patch.gz

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2013-03-26 Thread Heikki Linnakangas
On 30.12.2012 08:31, Daniel Farina wrote: A version implementing that is attached, except I generate an additional 64-bit session not exposed to the client to prevent even casual de-leaking of the session state. That may seem absurd, until someone writes a tool that de-xors things and relies on

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2012-12-29 Thread Daniel Farina
On Sat, Dec 29, 2012 at 7:16 PM, Daniel Farina wrote: > On Sat, Dec 29, 2012 at 7:12 PM, Peter Geoghegan > wrote: >> On 30 December 2012 02:45, Daniel Farina wrote: >>> As I recall, the gist of this objection had to do with a false sense >>> of stability of the hash value, and the desire to enf

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2012-12-29 Thread Daniel Farina
On Sat, Dec 29, 2012 at 7:12 PM, Peter Geoghegan wrote: > On 30 December 2012 02:45, Daniel Farina wrote: >> As I recall, the gist of this objection had to do with a false sense >> of stability of the hash value, and the desire to enforce the ability >> to alter it. Here's an option: xor the has

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2012-12-29 Thread Peter Geoghegan
On 30 December 2012 02:45, Daniel Farina wrote: > As I recall, the gist of this objection had to do with a false sense > of stability of the hash value, and the desire to enforce the ability > to alter it. Here's an option: xor the hash value with the > 'statistics session id', so it's *known* to

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2012-12-29 Thread Daniel Farina
On Sat, Dec 29, 2012 at 6:37 PM, Peter Geoghegan wrote: > On 29 December 2012 12:21, Daniel Farina wrote: >> These were not express goals of the patch, but so long as you are >> inviting features, attached is a bonus patch that exposes the queryid >> and also the notion of a "statistics session"

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2012-12-29 Thread Peter Geoghegan
On 29 December 2012 12:21, Daniel Farina wrote: > These were not express goals of the patch, but so long as you are > inviting features, attached is a bonus patch that exposes the queryid > and also the notion of a "statistics session" that is re-rolled > whenever the stats file could not be read

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2012-12-29 Thread Daniel Farina
On Sat, Dec 29, 2012 at 4:21 AM, Daniel Farina wrote: > These were not express goals of the patch, but so long as you are > inviting features, attached is a bonus patch that exposes the queryid > and also the notion of a "statistics session" that is re-rolled > whenever the stats file could not be

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2012-12-29 Thread Daniel Farina
Attached is a cumulative patch attempting to address the below. One can see the deltas to get there at https://github.com/fdr/postgres.git error-prop-pg_stat_statements-v2. On Fri, Dec 28, 2012 at 9:58 AM, Peter Geoghegan wrote: > However, with this approach, calls_underest values might appear t

Re: [HACKERS] pg_stat_statements: calls under-estimation propagation

2012-12-28 Thread Peter Geoghegan
On 28 December 2012 11:43, Daniel Farina wrote: > Without further ado, the cover letter taken from the top of the patch: > > This tries to establish a maximum under-estimate of the number of > calls for a given pg_stat_statements entry. That means the number of > calls to the canonical form of th