On Tue, Aug 12, 2014 at 5:59 AM, 楊新波 <silent0608@xxxxxxxxx> wrote: > why does the planer estimate 200 rows when i use order by and group by . > evn:postgresql 8.4 and 9.3 > Can anybody suggest something or explain this behavior? Because the table is empty, analyze doesn't store any stats for the table, so the planner uses some default guesses. This is actually beneficial for cases where you have done some inserts to a new table, and autovacuum hasn't gotten around to analyzing it yet. And it rarely hurts because any query plan will be fast when there's no data. Regards, Marti -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance