Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do a SELECT on a graph? Related to sql relations...

0 views
Skip to first unread message

mamcx

unread,
Jun 20, 2008, 4:20:55 PM6/20/08
to
Hi,

I have a graph that represent all the relations in a database. I'm
developing a end-user reporting tool with olap capabilities.

The DB have 25 tables. I wanna automagically deduce the relations only
knowing a small subset of the tables, ie:

The user select Quotes and Inventory.

But in the DB to join both tables, is necesary get into the query the
table Customer. If I have the graph with all the relations, and all the
nodes already have the tables that directly connect them, how query
(Quotes & Inventory) and get back (Quotes, Customer, Inventory)?

That its,imagine a common graphical DB schema, as in Sql Server or
generated in any DB Tool. I click in quotes & inventory and I know that
For the join, I need get the table customers.

By the way, Is not a must this be solved on graph structure. If exist a
simpler way, best!

Maarten Wiltink

unread,
Jun 20, 2008, 5:11:31 PM6/20/08
to
"mamcx" <th...@notexist.com> wrote in message
news:op.uc2dg...@jorge-pc.lan...

No, you need the graph. Finding the shortest path from Quotes to
Inventory isn't hard - it's a simple recursive algorithm that floods
out from the starting point, adding a 'ring' of new nodes in every
iteration until the entire graph is covered or the end point is
reached. Or, with weighted edges, until you're sure the path you've
found is shortest.

Although I don't think the shortest path is always what the user wants.
There will often be freak connections that throw off the algorithm.
And how does the direction of a relation influence things? All
solveable, though, and intelligence like this can really help in
making an application nice to work with.

Groetjes,
Maarten Wiltink


0 new messages