Table mytable
may have 0 .. 150000 rows in different databases.
How to determine whether it has more than approximately 100 rows rapidly?
It looks like this query:
select count(*)>100 from mytable
scans whole table, which takes lot of time. How to speed it up?
The upper bound of interest is not always exactly 100. It can be anything in the range (50, 150).
How to find has table more than 100 +/- 50 rows? Maybe statistic database used by query planner or some index count can used?
Using Postgres 12.2
ASP.NET MVC 6 application using EF Core and Npgsql.