I have this query
SELECT
count(*) filter(where condition) as cond_cnt
FROM table
LIMIT 100
But count happening on all table, not respecting LIMIT at all
If I do it with a subquery:
SELECT
count(*) filter(where condition) as cond_cnt
FROM
(SELECT *
FROM table
LIMIT 100
) as sub
Then it works fine. What I am missing?