How to speed up count()? #2427
Unanswered
Mulugruntz
asked this question in
Q&A
Replies: 1 comment 4 replies
-
This is a known characteristic of Postgres and is due to how it manages row visibility. See this Wiki page for some background. There's no good answer here, unfortunately. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The schema:
The query:
We can see that the
count
takes 85 seconds to complete for 27 million items. I find this pretty slow for an information without any filter. I would have imagined this to be O(1) (but it clearly isn't).Is it expected? Any suggestion?
Beta Was this translation helpful? Give feedback.
All reactions