Re: rows in explain

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: rows in explain
Дата
Msg-id 20050729184515.GA98486@winnie.fuhr.org
обсуждение исходный текст
Ответ на rows in explain  ("Lee Wu" <Lwu@mxlogic.com>)
Список pgsql-admin
On Fri, Jul 29, 2005 at 11:54:18AM -0600, Lee Wu wrote:
> explain select count(*) from pg_class where relname='pg_class';
>                           QUERY PLAN
> --------------------------------------------------------------
>  Aggregate  (cost=4.55..4.55 rows=1 width=0)
>    ->  Seq Scan on pg_class  (cost=0.00..4.55 rows=1 width=0)
>          Filter: (relname = 'pg_class'::name)
> (3 rows)
>
> Where and how PG get "rows=1"?

The planner uses statistics to estimate the number of rows that a
query will return.  Here are a couple of links that provide more
information:

http://www.postgresql.org/docs/8.0/static/planner-stats.html
http://www.postgresql.org/docs/8.0/static/view-pg-stats.html
http://www.postgresql.org/docs/8.0/static/sql-analyze.html
http://developer.postgresql.org/docs/postgres/planner-stats-details.html

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Lee Wu"
Дата:
Сообщение: rows in explain
Следующее
От: "Lee Wu"
Дата:
Сообщение: Re: rows in explain