Re: [HACKERS] What does explain show ?

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] What does explain show ?
Дата
Msg-id 199907140256.WAA10942@candle.pha.pa.us
обсуждение исходный текст
Ответ на What does explain show ?  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Ответы RE: [HACKERS] What does explain show ?  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Список pgsql-hackers
> Table a has 15905 rows and table b has 25905 rows.
> 
> 
> For the following query
> 
>   select a.pkey, b.key2 from a, b
>   where b.key1 = 1369
>   and     a.pkey = b.key1;
> 
> "explain" shows
> 
> NOTICE:  QUERY PLAN:
> 
> Nested Loop  (cost=6.19 rows=3 width=10)
>   ->  Index Scan using b_pkey on b on b  (cost=2.09 rows=2 width=6)
>   ->  Index Scan using a_pkey on a on a  (cost=2.05 rows=15905 width=4)
> 
> What does "rows=15905" of InnerPlan mean ?
> Is "rows=3" of Nested Loop irrelevant to "rows=15905" ?

It means it thinks it is going to access X rows in that pass, but end
up with 3 joined rows as a result of the nested loop.  It is only an
estimate, based on table size and column uniqueness from vacuum analyze.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: "Hiroshi Inoue"
Дата:
Сообщение: What does explain show ?
Следующее
От: "Hiroshi Inoue"
Дата:
Сообщение: RE: [HACKERS] What does explain show ?