SELECT
    COUNT(*) count
FROM
    post
WHERE
    ($1::text IS NULL OR site = $1)
    AND (
        NOT $2
        OR NOT is_read
    )
