What does explain show ?

Поиск
Список
Период
Сортировка
От Hiroshi Inoue
Тема What does explain show ?
Дата
Msg-id 000501becda2$03e6b580$2801007e@cadzone.tpf.co.jp
обсуждение исходный текст
Ответы Re: [HACKERS] What does explain show ?  (Bruce Momjian <maillist@candle.pha.pa.us>)
Re: [HACKERS] What does explain show ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi all,

I have a question about "explain" output.
Could someone teach me ?

Let a and b tables such that
 create table a ( int4    pkey  primary key, .... );
 create table b ( int4    key1, int2    key2, ...., primary key (key1,key2) );

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
Scanusing 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" ?

Regards.

Hiroshi Inoue
Inoue@tpf.co.jp


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

Предыдущее
От: "Hiroshi Inoue"
Дата:
Сообщение: 9-key index ?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] What does explain show ?