Re: [GENERAL] Problems with Greatest

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: [GENERAL] Problems with Greatest
Дата
Msg-id o83j8r$31t$1@blaine.gmane.org
обсуждение исходный текст
Ответ на Re: [GENERAL] Problems with Greatest  (Teddy Schmitz <teddy.schmitz@actuallywedo.com>)
Список pgsql-general
Teddy Schmitz schrieb am 16.02.2017 um 05:38:
> As a quick follow up I just did an explain on the query,
>
>
> Aggregate  (cost=258007258.87..258007258.88 rows=1 width=8)
> ->  Nested Loop  (cost=0.00..184292254.83 rows=14743000807 width=16)
> ->  Seq Scan on t1  (cost=0.00..3796.41 rows=263141 width=8)
> ->  Materialize  (cost=0.00..1088.40 rows=56027 width=8)
> ->  Seq Scan on t2  (cost=0.00..808.27 rows=56027 width=8)
>
>
> It seems it has to do a loop on 14 billion rows?  Can someone explain why this would happen?

You are not joining those two tables.

"from t1, t2" is a cross join that will calculate the cartesian product of both tables

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

Предыдущее
От: Teddy Schmitz
Дата:
Сообщение: Re: [GENERAL] Problems with Greatest
Следующее
От: Alessandro Baggi
Дата:
Сообщение: Re: [GENERAL] postgresql how to duplicate rows in result.