Re: [GENERAL] Fast join

Поиск
Список
Период
Сортировка
От Leon
Тема Re: [GENERAL] Fast join
Дата
Msg-id 3778F650.D55A536@udmnet.ru
обсуждение исходный текст
Ответ на Re: [GENERAL] Fast join  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-general
Herouth Maoz wrote:

> >
> > adb=>  EXPLAIN  SELECT COUNT(*) FROM atable WHERE atable.cfield =
> >btable.cfield
> > AND atable.afield>100;
>
> Hey, shouldn't these be:
>
> SELECT COUNT(*)
> FROM atable, btable  <----- Note this!
> WHERE atable.cfield = btable.cfield
> AND ....
>
> I'm not sure that when the other table is implicit, the optimizer checks
> the statistics of the btable on time.
>

adb=> EXPLAIN  SELECT * FROM atable,btable  WHERE atable.cfield = btable.cfield
AND atable.afield<10;
NOTICE:  QUERY PLAN:

Hash Join  (cost=1052.69 rows=3334 width=40)
  ->  Seq Scan on btable  (cost=399.00 rows=10000 width=20)
  ->  Hash  (cost=198.67 rows=3334 width=20)
        ->  Index Scan using aindex on atable  (cost=198.67 rows=3334 width=20)

--
Leon.



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] Fast join
Следующее
От: Leon
Дата:
Сообщение: Re: [GENERAL] Fast join