SELECT
    site,
    name,
    count (
        NOT is_read
        OR NULL
    ) unread
FROM
    post AS p
    JOIN feed AS f ON p.site = f.slug --
    -- TODO: figure this out to make the query faster when only looking for unread
    --WHERE
    --    (
    --        NOT $1
    --        OR NOT is_read
    --    )
GROUP BY
    1,
    2
ORDER BY
    site
