pg中count(*)优化
对于相对精准的统计使用抽样数据返回
SELECT 100 * count(*) AS estimate FROM user_stat TABLESAMPLE SYSTEM (1) where login_times between 1000 and 2000 ;
对于相对精准的统计使用抽样数据返回
SELECT 100 * count(*) AS estimate FROM user_stat TABLESAMPLE SYSTEM (1) where login_times between 1000 and 2000 ;