opteryx
opteryx copied to clipboard
🪲 COUNT(*) with literal returns incorrect result
SELECT 1, COUNT(*) AS c FROM hits GROUP BY 1 ORDER BY c DESC LIMIT 10;
returns COUNT(*) as 100, which is the number of files, not the number of rows.
what appears to be happening is the GROUP BY 1 is partially removed and the optimization for COUNT(*) with no groupings isn't evaluated correctly.