Skip to content

Instantly share code, notes, and snippets.

@kerbelp
Last active January 3, 2017 20:47
Show Gist options
  • Save kerbelp/36784db136a7d02acd818f8a3ad958f1 to your computer and use it in GitHub Desktop.
Save kerbelp/36784db136a7d02acd818f8a3ad958f1 to your computer and use it in GitHub Desktop.
CREATE OR REPLACE VIEW admin.v_vacuum_jobs_summary
AS
SELECT DISTINCT us.usename, perm.name, vac.eventtime, trunc(vac.eventtime) AS date, vac.status, vac."rows", vac.sortedrows
FROM stl_vacuum vac
JOIN stv_tbl_perm perm ON perm.id = vac.table_id
JOIN pg_user us ON us.usesysid = vac.userid
WHERE trunc(vac.eventtime) >= trunc('now' - 1)
ORDER BY vac.eventtime DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment