Re: parallel-processing multiple similar query tasks - any example?

Поиск
Список
Период
Сортировка
От Steve Midgley
Тема Re: parallel-processing multiple similar query tasks - any example?
Дата
Msg-id CAJexoSJy1yXa9vQuoN0U8ykf0w29yWJWw9aODak6sHsx+wzjNw@mail.gmail.com
обсуждение исходный текст
Ответ на parallel-processing multiple similar query tasks - any example?  (Shaozhong SHI <shishaozhong@gmail.com>)
Ответы Re: parallel-processing multiple similar query tasks - any example?  (Shaozhong SHI <shishaozhong@gmail.com>)
Список pgsql-sql


On Wed, Apr 27, 2022 at 4:34 PM Shaozhong SHI <shishaozhong@gmail.com> wrote:



multiple similar query tasks are as follows:

select * from a_table where country ='UK'
select * from a_table where country='France'
and so on

How best to parallel-processing such types of multiple similar query tasks?


This depends on how you are engaging with the queries when they return results. Let's assume you are running them from a programming environment with an ORM layer. In that case you can run each query in a separate thread and connection pipe, and the queries will run async just fine. If you are running at the command line using psql, you can just open multiple shells and run each query from a different shell terminal.

Postgres is very good at async queries, so your challenge is really figuring out how you will use the results of each query and setting up the environment sending the queries to perform asynchronously.

Steve

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

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: xargs psql
Следующее
От: Shaozhong SHI
Дата:
Сообщение: Re: parallel-processing multiple similar query tasks - any example?