"Retrieve exact row counts" preference is very dangerous
- Dominant language
- Python
- Stars
- 486
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
You can use this template for reporting bugs.
Feel free to remove parts that are not relevant, or just write something free-form if you prefer.
## What did you do?
By default the preference for "Retrieve exact row counts" is ON, which will issue a COUNT on the table if you select it and view it. This can be VERY BAD if it occurs on a large production database. I have had a DB server crash due to this preference being on by default.
## What did you expect to happen?
My recommendation would be to apply some heuristic that will never automatically fetch an exact row count if the approximate row count is above X, where X could be say 100,000. The user can always issue a query to get the exact row count if they want it.
## What actually happened?
My database server crashed and my application was down for several minutes.
## What software versions are you using?
Postico version: 1.5.7
macOS version: 10.15.1
(selecting "About this Mac" from the Apple menu)
PostgreSQL version: 11.0
(execute the command "SELECT VERSION();" to find out)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the issue in Postico 1.5.7 on macOS 10.15.1 with PostgreSQL 11.0: select a table and view it while “Retrieve exact row counts” is enabled. Trace the row-count preference behavior and verify that large tables do not automatically trigger an exact count, while smaller tables retain the expected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100