Re: Log size in bytes of query result

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



@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@xxxxxxxx> 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

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux