pg中count(*)优化

对于相对精准的统计使用抽样数据返回

SELECT 100 * count(*) AS estimate FROM user_stat   TABLESAMPLE SYSTEM (1)  where login_times between 1000 and 2000 ;

 

posted @ 2023-12-21 09:23  白玉神驹  阅读(6)  评论(0编辑  收藏  举报