Re: [GENERAL] postgreSQL multithreading

From: postgre(at)seznam(dot)cz
To: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] postgreSQL multithreading
Date: 2008-03-30 16:18:45
Message-ID: 1283.1762-20801-1365715198-1206893925@seznam.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> ------------ Původní zpráva ------------
> Od: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
> Předmět: Re: [GENERAL] postgreSQL multithreading
> Datum: 30.3.2008 17:39:02
> ----------------------------------------
> postgre(at)seznam(dot)cz <postgre(at)seznam(dot)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.
>
>
What about some C dynamically loaded function in which I could call new connection for each thread?

Lukas Houf

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ross Boylan 2008-03-30 17:05:22 database 1.2G, pg_dump 73M?!
Previous Message Andreas Kretschmer 2008-03-30 15:36:52 Re: postgreSQL multithreading