Skip to content

Commit

Permalink
Improve powa_wait_sampling_history query
Browse files Browse the repository at this point in the history
There is a bug: the result is still ok, but it's a performance isuse

The left boundary query for powa_base_waitdata_detailed_db on the
interval is wrong: the matching interval should be from/from (see other
queries that do the same manipulation)
  • Loading branch information
marco44 committed Feb 7, 2025
1 parent 55e8b54 commit ab4ab06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion powa/sql/views_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def powa_base_waitdata_detailed_db():
SELECT wsh.dbid, wsh.queryid, wsh.event_type, wsh.event,
wsh.coalesce_range, unnest(records) AS records
FROM {powa}.powa_wait_sampling_history wsh
WHERE coalesce_range && tstzrange(%(from)s, %(to)s, '[]')
WHERE coalesce_range && tstzrange(%(from)s, %(from)s, '[]')
AND wsh.dbid = powa_databases.oid
-- we can't simply join powa_statements as there's no userid in
-- powa_wait_sampling_* tables
Expand Down

0 comments on commit ab4ab06

Please sign in to comment.