Re: [Plproxy-users] A complex plproxy query - Mailing list pgsql-general

From Marko Kreen
Subject Re: [Plproxy-users] A complex plproxy query
Date
Msg-id e51f66da0901220313o645ac590lf270b00a305aab89@mail.gmail.com
Whole thread Raw
In response to Re: [Plproxy-users] A complex plproxy query  (Igor Katson <descentspb@gmail.com>)
Responses Re: [Plproxy-users] A complex plproxy query  (Igor Katson <descentspb@gmail.com>)
List pgsql-general
On 1/22/09, Igor Katson <descentspb@gmail.com> wrote:
> Hannu Krosing wrote:
>  > On Thu, 2009-01-22 at 02:33 +0300, Igor Katson wrote:
>  >
>  >
>  >> So to say, give me the list of friends (not only their ID's, but all the
>  >> needed columns!) of given individual, which are in a given group. That
>  >> seems ok without plproxy, but with using it, I can't imagine how can I
>  >> form a nice query, or a function (or a set of plpgsql + plproxy
>  >> functions) to do the job.
>  >>
>  >
>  > You need to do it in two steps - first run a query on the partition the
>  > user is in to get list of friends ids, then run a second RUN ON ALL
>  > query with
>  >
>  > WHERE f.friend.id in (list of ids from f1) AND f.group_id = $2
>  >
>  > to gather all friend info in parallel
>  >
>  >
>
> I was thinking about that. But I don't understand, how can I pass the
>  list of id's. Should I turn the output of a select into an array? How
>  then? What if the array gets hundreds of items long?

Yes, array works fine.  And if it's long, then let it be long...

--
marko

pgsql-general by date:

Previous
From: Grzegorz Jaśkiewicz
Date:
Subject: Re: how to avoid that a postgres session eats up all the memory
Next
From: Reg Me Please
Date:
Subject: Re: how to specify the locale that psql uses