Re: join removal

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: join removal
Дата
Msg-id 162867791003290119v7be285f1q6f49be88bb7213e9@mail.gmail.com
обсуждение исходный текст
Ответ на Re: join removal  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: join removal  (Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>)
Список pgsql-hackers
Hello

is any reason why join removal doesn't remove useless relation b?

postgres=# \d a      Table "public.a"Column |  Type   | Modifiers
--------+---------+-----------a      | integer |
Indexes:   "a_a_idx" UNIQUE, btree (a)

postgres=# \d b      Table "public.b"Column |  Type   | Modifiers
--------+---------+-----------b      | integer |
Indexes:   "b_b_idx" UNIQUE, btree (b)

postgres=# explain select  a from a left join b on true;                           QUERY PLAN
-------------------------------------------------------------------Nested Loop Left Join  (cost=0.00..72074.00
rows=5760000width=4)  ->  Seq Scan on a  (cost=0.00..34.00 rows=2400 width=4)  ->  Materialize  (cost=0.00..46.00
rows=2400width=0)        ->  Seq Scan on b  (cost=0.00..34.00 rows=2400 width=0)
 
(4 rows)

postgres=# explain select distinct a from a left join b on true;                                  QUERY PLAN
---------------------------------------------------------------------------------Unique  (cost=0.00..86520.25 rows=2400
width=4) ->  Nested Loop Left Join  (cost=0.00..72120.25 rows=5760000 width=4)        ->  Index Scan using a_a_idx on a
(cost=0.00..80.25 rows=2400 width=4)        ->  Materialize  (cost=0.00..46.00 rows=2400 width=0)              ->  Seq
Scanon b  (cost=0.00..34.00 rows=2400 width=0)
 
(5 rows)

Regards
Pavel Stehule


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: More idle thoughts
Следующее
От: Joachim Wieland
Дата:
Сообщение: Re: five-key syscaches