how does the planer to estimate row when i use order by and group by

Поиск
Список
Период
Сортировка
От 楊新波
Тема how does the planer to estimate row when i use order by and group by
Дата
Msg-id CAK=TrEEHgo9Lwk3O5MQqqjUTX=21-zTyNaeqKdhhXyhBsKqhLA@mail.gmail.com
обсуждение исходный текст
Ответы Re: how does the planer to estimate row when i use order by and group by
Список pgsql-performance
hi ,everybody

why does the planer estimate 200 rows when i use order by and group by .
evn:postgresql 8.4 and 9.3

table:
CREATE TABLE a
(
  id serial NOT NULL,
  name character varying(20),
  modifytime timestamp without time zone,
  CONSTRAINT a_pk PRIMARY KEY (id)
)

SQL:
explain  analyze
select * from 
( select id from a order by id ) d 
group by  id;

Query plan:
"Group  (cost=0.15..66.42 rows=200 width=4) (actual time=0.008..0.008 rows=0 loops=1)"
"  ->  Index Only Scan using a_pk on a  (cost=0.15..56.30 rows=810 width=4) (actual time=0.006..0.006 rows=0 loops=1)"
"        Heap Fetches: 0"
"Total runtime: 0.046 ms"

Can anybody suggest something or explain this behavior?

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

Предыдущее
От: Maxim Boguk
Дата:
Сообщение: Re: Optimization idea for long IN() lists
Следующее
От: Mark Kirkwood
Дата:
Сообщение: Re: 60 core performance with 9.3