Skip to content

2.27.0.0-b565

@abhinab-yb abhinab-yb tagged this 15 Sep 04:31
Summary:
This diff adds the following RPC stats in pg_stat_statements -
- docdb_read_rpcs
- docdb_read_operations
- docdb_write_rpcs
- docdb_write_operations
- docdb_wait_time
- docdb_rows_scanned
- catalog_wait_time

A new GUC `yb_enable_pg_stat_statements_rpc_stats`
is added which decides whether to capture RPC wait times or not.

If the GUC is false, the RPC wait times won't be reported and all the other stats will
still be reported because they were already being captured and the overhead of
capturing them is negligible.

This diff also moves the call of YbRefreshSessionStatsDuringExecution() from
yb_exec_execute_message to the sync packet because pg_stat_statements
stores the query related stats only on the sync packet.

The stats for EXPLAIN (ANALYZE, DIST) queries are not captured because
the stats are refreshed before reaching pg_stat_statements' ExecutorEnd.

Perf run: https://perf.dev.yugabyte.com/report/view/W3siaXNCYXNlbGluZSI6ZmFsc2UsIm5hbWUiOiJTZWxlY3RlZCBUZXN0LWlkIiwidGVzdF9pZCI6MTMxOTAzMDJ9LHsiaXNCYXNlbGluZSI6dHJ1ZSwibmFtZSI6IkJhc2VsaW5lIiwidGVzdF9pZCI6IjEzMTg3ODAyIn1d
Jira: DB-18160

Test Plan:
./yb_build.sh --java-test TestPgStatStatements#testSelectRpcStats
./yb_build.sh --java-test TestPgStatStatements#testInsertRpcStats
./yb_build.sh --java-test TestPgStatStatements#testUpdateRpcStats
./yb_build.sh --java-test TestPgStatStatements#testDeleteRpcStats

Reviewers: kramanathan, ishan.chhangani

Reviewed By: kramanathan

Subscribers: jason, yql

Differential Revision: https://phorge.dev.yugabyte.com/D46424
Assets 2
Loading