From: | "Katsaros Kwn/nos" <ntinos(at)aueb(dot)gr> |
---|---|
To: | Richard Huxton <dev(at)archonet(dot)com> |
Cc: | PostgreSQL General <pgsql-general(at)postgresql(dot)org>, Postgres Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Networking feature for postgresql... |
Date: | 2004-10-16 10:40:26 |
Message-ID: | 1097923226.5268.89.camel@localhost.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-hackers |
Hi again,
Having taken a look at the dblink code I have some questions:
Having a user defined function, is it possible -with no serious memory
overheads- to fork it (outside SPI calls code) in order to make
concurrent dblink calls? What I'm thinking of doing is to create a
function which opens an SPI session, creates some objects (Query nodes),
closes it and then forks as many times as the number of required dblink
calls (having available the appropriate Query node, something like
for(all nodes) fork();...).
My guess is that it is possible cause the backend calls for dblink are
done on the other side (when speaking for Select statements
only).However the returned tuples can only be merged (to produce the
final result) in main memory cause storing them first (e.g. temp table)
would need concurrent SPI calls.Am I right? If so is there any
mechanism that can multiplex this storing procedures?
On the other side, I suppose a server can serve multiple incoming
queries.
Regards,
Ntinos Katsaros
On Thu, 2004-10-14 at 11:57, Richard Huxton wrote:
> Katsaros Kwn/nos wrote:
> > Well, actually no :) ! Thanks for the hint!
> >
> > But just from curiosity, would the scenario I described work?
> > I mean is it possible for an SPI process to run in the background while
> > other SPI calls are made?
>
> I don't think so, you're running in a backend process, so you'd need to
> fork the backend itself.
>
> > On Thu, 2004-10-14 at 11:15, Richard Huxton wrote:
> >
> >>Katsaros Kwn/nos wrote:
> >>
> >>>Hi,
> >>>
> >>>I'm trying to add a -project specific- networking feature to my postgres
> >>>build (or database as function). What I want to do is to send a Query
> >>>instance (as a String-retrieved through an SPI function) to other
> >>>machines and (after they have executed it) to receive result tuples.
> >>>It's about a mediator-wrapper project. My first thought was to write 2
> >>>SPI functions (one for the server (concurrent) and the other for client)
> >>>but I'm not sure if this is going to work. I'm worried about setting up
> >>>the server process running on the background while other SPI calls are
> >>>made.
> >>
> >>Have you looked at the dblink code?
>
From | Date | Subject | |
---|---|---|---|
Next Message | Janning Vygen | 2004-10-16 12:26:53 | Re: Avoiding sequential scans with OR join condition |
Previous Message | Michael Fuhr | 2004-10-16 06:59:34 | Re: plpgsql loop not returning value |
From | Date | Subject | |
---|---|---|---|
Next Message | Neil Conway | 2004-10-16 13:45:12 | Re: Why we still see some reports of "could not access |
Previous Message | Tatsuo Ishii | 2004-10-16 05:30:44 | Re: Nearing final release? |