Re: [Plproxy-users] A complex plproxy query

From: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
To: Igor Katson <descentspb(at)gmail(dot)com>
Cc: plproxy-users(at)pgfoundry(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [Plproxy-users] A complex plproxy query
Date: 2009-01-22 01:26:17
Message-ID: 1232587577.8708.4.camel@huvostro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

--
------------------------------------------
Hannu Krosing http://www.2ndQuadrant.com
PostgreSQL Scalability and Availability
Services, Consulting and Training

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rodrigo E. De León Plicet 2009-01-22 05:11:48 Re: Check if column is substring of another column
Previous Message Bruce Momjian 2009-01-22 01:10:32 Re: encoding of PostgreSQL messages