Re: [SQL] two queryes in a single tablescan

Поиск
Список
Период
Сортировка
От Markus Schaber
Тема Re: [SQL] two queryes in a single tablescan
Дата
Msg-id 20071020125824.75df357c@kingfisher.sec.intern.logix-tt.com
обсуждение исходный текст
Ответ на two queryes in a single tablescan  ("Stefano Dal Pra" <s.dalpra@gmail.com>)
Ответы Re: [SQL] two queryes in a single tablescan
Список pgsql-performance
Hi, Stefano,

"Stefano Dal Pra" <s.dalpra@gmail.com> wrote:

> suppose you have a large table tab and two (or more) queryes like this:
>
> SELECT count(*),A FROM tab WHERE C GROUP BY A;
> SELECT count(*),B FROM tab WHERE C GROUP BY B;
>
> is there any way to get both results in a single query,
> eventually through stored procedure?
> The retrieved [count(*),A] ; [count(*),B)] data couldnt fit
> on a single table, of course.
>
> The main goal would be to get multiple results while scanning the
> table[s] once only
> thus getting results in a faster  way.

PostgreSQL 8.3 contains great improvements in this area, you can simply
start the selects from concurrent connections, and the backend will
synchronize the scans.



Regards,
Markus

--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org

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

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: how to improve the performance of creating index
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: [SQL] two queryes in a single tablescan