Re: Split query

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Katsaros Kwn/nos <ntinos(at)aueb(dot)gr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Split query
Date: 2004-11-02 08:53:02
Message-ID: 1099385582.21062.518.camel@sabrina.peacock.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

On Tue, 2004-11-02 at 07:47, Katsaros Kwn/nos wrote:
> Hi!
>
> I want to parse a query (SFW) and create new queries: one for each
> table referenced, if that possible.
> I've written a function for this in the Query struct level after
> parse&rewrite (not very general ofcourse :-)) but I would like to
> know whether there is any code written for this purpose at any level.
> Are there any algorithms for this?
> Following, is there any code or at least some algorithm about merging
> the individual results returned from these queries?

The latter is easy. Consider:

SELECT ... FROM
(SELECT ... first query here) AS table_a
JOIN
(SELECT ... second query here) AS table_b
USING (same_column);

(or ON table_a.column = table_b.column)

I dont think you should think about joining results
outside the database. You have Postgresql here, remember :-)

Regards
Tino

In response to

  • Split query at 2004-11-02 06:47:51 from Katsaros Kwn/nos

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Einar Már Björvinsson 2004-11-02 09:00:58
Previous Message Peter Eisentraut 2004-11-02 08:48:54 Re: Postgres Versions / Releases