How to read a query plan?

Поиск
Список
Период
Сортировка
От elwood@agouros.de (Konstantinos Agouros)
Тема How to read a query plan?
Дата
Msg-id elwood.987583040@news.agouros.de
обсуждение исходный текст
Ответы Re: How to read a query plan?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: How to read a query plan?  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-general
Hi,

since I am still working on my quite big database and the last time a simple
index saved my life I would like to understand query plans. Here are two
one without and one with index I see different numbers, but would like to know
what they mean:
logs=> explain select distinct on (url) url, category, action from websenseflat where webhost='dir.yahoo.com' and datum
>='1-26-2001'and datum < '1-27-2001'; 
NOTICE:  QUERY PLAN:

Unique  (cost=0.01..0.01 rows=1 width=36)
  ->  Sort  (cost=0.01..0.01 rows=1 width=36)
        ->  Seq Scan on websenseflat  (cost=0.00..0.00 rows=1 width=36)

EXPLAIN

after this I created an index on the field webhost, now the query plan says:

NOTICE:  QUERY PLAN:

Unique  (cost=19690.08..19690.22 rows=5 width=36)
  ->  Sort  (cost=19690.08..19690.08 rows=53 width=36)
        ->  Index Scan using wsflwebhost on websenseflat  (cost=0.00..19688.55 rows=53 width=36)

EXPLAIN

Could someone give me an interpretation (or a URL that explains this)?

Thanks,

Konstantin
--
Dipl-Inf. Konstantin Agouros aka Elwood Blues. Internet: elwood@agouros.de
Otkerstr. 28, 81547 Muenchen, Germany. Tel +49 89 69370185
----------------------------------------------------------------------------
"Captain, this ship will not sustain the forming of the cosmos." B'Elana Torres

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

Предыдущее
От: DaVinci
Дата:
Сообщение: Passing a row (NEW) as function argument
Следующее
От: newsreader@mediaone.net
Дата:
Сообщение: watch your DBI scripts if you are upgrading to 7.1