Re: PsqlODBC slow on UNION queries

Поиск
Список
Период
Сортировка
От Zoltan Boszormenyi
Тема Re: PsqlODBC slow on UNION queries
Дата
Msg-id 43C1FEEF.5060107@dunaweb.hu
обсуждение исходный текст
Ответ на Re: PsqlODBC slow on UNION queries  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: PsqlODBC slow on UNION queries  (Ludek Finstrle <luf@pzkagis.cz>)
Список pgsql-odbc
Tom Lane írta:

>Zoltan Boszormenyi <zboszor@dunaweb.hu> writes:
>
>
>>We have some large views, consisting of 6+ UNION members.
>>Recently, I rewrote them to use UNION ALL, since the members
>>give distinct rows across the whole view.
>>
>>
>
>
>
>>The performance difference between the two is enormous, e.g. using UNION,
>>the rows starts flowing only after 30-32 seconds but when using UNION ALL,
>>it starts instantly.
>>
>>
>
>Well, UNION requires fetching all the source rows and then doing a
>duplicate-elimination step (sort+uniq basically).  Why does the
>performance change surprise you?
>
>            regards, tom lane
>
>

Well, as I said, doing the same test from PSQL, the performance
difference is much less. I was really asking about the difference
between psql and PsqlODBC:

                            psql(output to file)         psqlodbc
UNION               total time: < 12 sec        first row received after
30 seconds
UNION ALL      total time < 4 sec           first row received instantly

My question is, why does PsqlODBC does the same unique
seach again, when the server already did it? Only this would explain
the difference between the psql and PsqlODBC timings.

Best regards,
Zoltán Böszörményi


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PsqlODBC slow on UNION queries
Следующее
От: zhaoxin
Дата:
Сообщение: Output parameter isn't available ???