Re: Inequality operators are not deduced.

Поиск
Список
Период
Сортировка
От ITAGAKI Takahiro
Тема Re: Inequality operators are not deduced.
Дата
Msg-id 20070216120322.6522.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
обсуждение исходный текст
Ответ на Inequality operators are not deduced.  (ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Список pgsql-general
I wrote:
> However, it seems to be inapplicable for inequality operators. The plan
> was improved after I added the deduce-able 'U.i = 100' in theory.

Sorry, there was a miss. The correct is 'U.i < 100'.

>
> EXPLAIN SELECT * FROM T, U WHERE T.i = U.i AND T.i < 100;
>                                  QUERY PLAN
> -----------------------------------------------------------------------------
>  Merge Join  (cost=0.00..340.38 rows=100 width=8)
>    Merge Cond: (t.i = u.i)
>    ->  Index Scan using t_pkey on t  (cost=0.00..10.00 rows=100 width=4)
>          Index Cond: (i < 100)
>    ->  Index Scan using u_pkey on u  (cost=0.00..3048.26 rows=100000 width=4)
>
> EXPLAIN SELECT * FROM T, U WHERE T.i = U.i AND T.i < 100 AND U.i < 100;
>                                QUERY PLAN
> -------------------------------------------------------------------------
>  Merge Join  (cost=0.00..11.32 rows=1 width=8)
>    Merge Cond: (t.i = u.i)
>    ->  Index Scan using t_pkey on t  (cost=0.00..10.00 rows=100 width=4)
>          Index Cond: (i < 100)
>    ->  Index Scan using u_pkey on u  (cost=0.00..9.94 rows=96 width=4)
>          Index Cond: (i < 100)


Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Inequality operators are not deduced.
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: How to append the contents of a table to a file