Re: Trying to eliminate union and sort

Поиск
Список
Период
Сортировка
От Brian Fehrle
Тема Re: Trying to eliminate union and sort
Дата
Msg-id 51E41F64.7090102@consistentstate.com
обсуждение исходный текст
Ответ на Re: Trying to eliminate union and sort  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: Trying to eliminate union and sort
Список pgsql-performance
On 07/12/2013 04:43 PM, Josh Berkus wrote:
>> As for the counts on the tables:
>> table1      3,653,472
>> table2      2,191,314
>> table3    25,676,589
>>
>> I think it's safe to assume right now that any resulting joins are not
>> one-to-one
> Hmmm?  How is doing a subselect in the SELECT clause even working, then?
>
Oh my, this is sad. the query in all returns 9,955,729 rows, so the sub
queries are run on each of these resulting rows, however in this entire
result set, subquery 1 returns 16 distinct rows, subquery 2 returns 63
different rows, but those sub queries are run over 10 million times to
return these few distinct rows. So it's running many times, but
returning the same small set of data over and over again.

- Brian F




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

Предыдущее
От: Sergey Konoplev
Дата:
Сообщение: Re: how to speed up the index creation in GP?
Следующее
От: Marcos Luis
Дата:
Сообщение: Thought you'd find this interesting