473,395 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Split query

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?

Thanks in advance!
Ntinos Katsaros
Nov 23 '05 #1
4 4808
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
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #2
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
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #3
Well, the second question is trivial indeed :-) ,even though I had
pipelining in mind when writting it...
(which is not so query oriented but rather plan/executor oriented)
However, I'm more interested in the first question.

Thank you very much,
Ntinos
Tino Wildenhain wrote:
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

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #4
Well, the second question is trivial indeed :-) ,even though I had
pipelining in mind when writting it...
(which is not so query oriented but rather plan/executor oriented)
However, I'm more interested in the first question.

Thank you very much,
Ntinos
Tino Wildenhain wrote:
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

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: uc_sk | last post by:
Hello All I am a newbie to PERL language...If i have a file with data of form abcd 4 {1,2,3} 3 lmn- 3 {12,18,19,22} 4 then i can read them as... ($list $listTotal $set $noElements) = split /...
8
by: middletree | last post by:
Sorry for starting a new thread, but the original was 24 hours ago, and I am afraid it won't get seen. In the original, Ray advised me to change if len(strPeopleID)>0 then arrPeople =...
2
by: needin4mation | last post by:
Hi, thanks for any help here: SqlCommand cmd = new SqlCommand("SELECT categories FROM catalog" conn); rdr = cmd.ExecuteReader(); String temp; while (rdr.Read()) { temp = rdr;...
8
by: ronrsr | last post by:
I'm trying to break up the result tuple into keyword phrases. The keyword phrases are separated by a ; -- the split function is not working the way I believe it should be. Can anyone see what I"m...
12
by: garyusenet | last post by:
string lines = File.ReadAllLines(@"c:\text\history.txt"); foreach (string s in lines) { ArrayList results = new ArrayList(); string delimit = ";"; string currentline = s.Split(";"); ...
6
by: Stan | last post by:
I am working on a database in ACCESS 2003. This is a simple DB with only one table. I have split the DB so I can upgrade and debug the front end before installing on my clients' computer. I used...
0
by: =?ISO-8859-15?Q?C=E9dric?= | last post by:
Hi all, I want to import a SQL script (SQLite) executing each queries separately. - I read the SQL file - I split the read string with the separator ";" - I execute each query string query...
4
by: mikevde | last post by:
Hi, I have a query where I select all the values from my MS SQL table that are LIKE a certain string. The query works, but in the ASP page, I only want to write the date once, while writing the...
5
by: kumarboston | last post by:
Hi All, I fetched a sequence from my database into mysql_query and then I want to split in the group of 60 and print it. I am using while loop and pushing into array and then trying to split it and...
2
bugboy
by: bugboy | last post by:
Does the total number of rows in a table determine the amount of resources required for a query?.. or is it primarily determined by the number of rows used by the query? ..Does an INDEX mean it...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.