Re: how does the planer to estimate row when i use order by and group by - Mailing list pgsql-performance

From Marti Raudsepp
Subject Re: how does the planer to estimate row when i use order by and group by
Date
Msg-id CABRT9RBdQvdXjhY5qKEAkXvRqT+zBBazehqnV9hoAaOtDpYHDA@mail.gmail.com
Whole thread Raw
In response to how does the planer to estimate row when i use order by and group by  (楊新波 <silent0608@gmail.com>)
List pgsql-performance
On Tue, Aug 12, 2014 at 5:59 AM, 楊新波 <silent0608@gmail.com> 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


pgsql-performance by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: 60 core performance with 9.3
Next
From: Josh Berkus
Date:
Subject: Re: 60 core performance with 9.3