-
-
Save yulisunny/b263bb0f00b81ac9f036faac97cf9caa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH persisted_rate AS ( | |
SELECT | |
date_trunc('minute', persisted_time) AS persisted_minute, | |
count(*) AS num_persisted | |
FROM persistent_queue_table | |
GROUP BY persisted_minute | |
), | |
polled_rate AS ( | |
SELECT | |
date_trunc('minute', poll_time) AS poll_minute, | |
count(*) AS num_polled | |
FROM persistent_queue_table | |
GROUP BY poll_minute | |
), | |
SELECT | |
persisted_minute AS minute, | |
num_persisted, | |
num_polled | |
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