Skip to content

Instantly share code, notes, and snippets.

Created April 29, 2016 15:00
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save yulisunny/b263bb0f00b81ac9f036faac97cf9caa to your computer and use it in GitHub Desktop.
WITH persisted_rate AS (
date_trunc('minute', persisted_time) AS persisted_minute,
count(*) AS num_persisted
FROM persistent_queue_table
GROUP BY persisted_minute
polled_rate AS (
date_trunc('minute', poll_time) AS poll_minute,
count(*) AS num_polled
FROM persistent_queue_table
GROUP BY poll_minute
persisted_minute AS minute,
FROM persisted_rate
INNER JOIN polled_rate ON persisted_minute = poll_minute
ORDER BY minute;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment