Re: postgreSQL multithreading - Mailing list pgsql-general

From Andreas Kretschmer
Subject Re: postgreSQL multithreading
Date
Msg-id 20080330153652.GA12067@KanotixBox
Whole thread Raw
In response to postgreSQL multithreading  (postgre@seznam.cz)
Responses Re: [GENERAL] postgreSQL multithreading
List pgsql-general
postgre@seznam.cz <postgre@seznam.cz> schrieb:

> Hi all,
>
> I was trying to find some way to implement multithreading into my postgreSQL stored functions.
>
> The thing is, that I have data stored in multiple tables - for each day one table - and I want to write
> a function which selects data from these tables and stores them into files (or just returns the data in cursor);
> Information about data stored in these tables are in another table defined like this:
>
> partitions_daily(from_date timestamp, to_date timestamp, table_name)
>
> From_date and to_date tells in which table the requested data should be found.
>
> In this time I have function through which I can get the data, the problem is that everything is processed with only
> one CPU core. I think it should be very easy to make this model to be multithreaded and use more CPU cores.

I think, the only way to achieve this is to use multiple connections to
the database. One connection to select the table_name and than, for
every table_name, a own connection to the database to select and write
the data to files.


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

pgsql-general by date:

Previous
From: postgre@seznam.cz
Date:
Subject: postgreSQL multithreading
Next
From: postgre@seznam.cz
Date:
Subject: Re: [GENERAL] postgreSQL multithreading