I don't think the question flagged as duplicate addresses what happens in this specific case where over()
is used without arguments so I'll post an answer despite the dupe flags...
For some window functions the partition and order by clauses are optional; count
being one on them as applying count to a variable without partitioning makes perfect sense - the count will apply over the entire set - whereas a function like rank or row_number won't make any sense whatsoever without some kind of order.
Quoting the reference documentation:
If PARTITION BY is not specified, the function treats all rows of the
query result set as a single group.
If ORDER BY is not specified entire partition is used for a window
frame. This applies only to functions that do not require ORDER BY
clause.