Re: Log size in bytes of query result

From: Franklin Haut <franklin(dot)haut(at)gmail(dot)com>
To: "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Log size in bytes of query result
Date: 2019-05-22 12:50:52
Message-ID: CAN1QLZJG94cHDr-J0m-V3g8cTbE2JuXzzcX5TeGp+Q524EMq2g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

@Sergei and @Laurenz Thank you for reply.

I think it is important to have other resource indicators consumed by the
query besides the execution time as the amount of Bytes sent / received by
each query, how many blocks / bytes were read / written from the cache or
had to be loaded from the disk or even CPU cycles .

With this information we can make more efficient adjustments to the queries
and improve the management of the resources, especially in virtualized
environments, where we often can not identify the real reason for poor
performance delivery, whether it is in the structure modeling or if there
is a dispute over resources by other virtual machines.

By my analysis, I see that the most efficient way to perform this control
would be in the existing medium in postgresql that is the log file (pg_log)
adding a few more variables for each query executed.

* Bytes Received (ethernet)
* Bytes Sent (ethernet)
* Bytes Written (disk)
* Bytes read only cache (cache hit)
* Bytes Read from disk (cache miss)
* CPU Time

Unfortunately I do not have the necessary knowledge to assist in the
implementation of these features and I want to leave it as a suggestion for
a new version.

regards,

Em sex, 10 de mai de 2019 às 13:42, Sergei Kornilov <sk(at)zsrv(dot)org> escreveu:

> Hi
>
> > extension that hooks into PostgreSQL
>
> We have any hooks that can be used for such purposes?
> Sometimes I think how to implement counters "bytes sent to client"/"bytes
> recv from client" in pg_stat_statements but did not found good place. Where
> we can accumulate such counters and how they can be accessible from
> extension? Extend DestReceiver or add counter directly in
> src/backend/libpq/pqcomm.c ?
>
> PS: some returned with feedback old patch:
> https://www.postgresql.org/message-id/flat/CAHhq2wJXRqTMJXZwMAOdtQOkxSKxg_aMxxofhvCo%3DRGXvh0AUg%40mail.gmail.com
>
> regards, Sergei
>

--
Atenciosamente,

Franklin Haut

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Dmitry Dolgov 2019-05-22 13:15:16 Re: Log size in bytes of query result
Previous Message Justin Pryzby 2019-05-22 04:43:09 Re: Use Postgres as a column store by creating one table per column