Re: Queries Per Second (QPS) - Mailing list pgsql-performance

From Guillaume Lelarge
Subject Re: Queries Per Second (QPS)
Date
Msg-id CAECtzeWJk=_miFoqU5Bx7suuWcX1jjHAUTZi1Uo8uyHDxTLh_A@mail.gmail.com
Whole thread Raw
In response to Re: Queries Per Second (QPS)  (Guillaume Lelarge <guillaume@lelarge.info>)
Responses Re: Queries Per Second (QPS)  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-performance

Le 27 sept. 2015 8:02 AM, "Guillaume Lelarge" <guillaume@lelarge.info> a écrit :
>
> Le 26 sept. 2015 6:26 PM, "Adam Scott" <adam.c.scott@gmail.com> a écrit :
> >
> > How do we measure queries per second (QPS), not transactions per second, in PostgreSQL without turning on full logging which has a performance penalty and can soak up lots of disk space?
> >
>
> The only way I can think of is to write an extension that will execute some code at the end of the execution of a query.
>
> Note that this might get tricky. Do you want to count any query? Such as those in explicit transactions and those in plpgsql functions? People might not see this your way, which may explain why I don't know of any such extension.
>

Thinking about this, such an extension already exists. It's pg_stat_statements. You need to sum the count column of the pg_stat_statements from time to time. The difference between two sums will be your number of queries.

> > We are using 8.4, but I'm interested in any version as well.
> >

pgsql-performance by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: Queries Per Second (QPS)
Next
From: Jeff Janes
Date:
Subject: Re: Queries Per Second (QPS)