![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
Gerard H. Pille wrote: I've been keeping both my eyes on performance in programming for over 35 years now. Of course, I can only do as much as your design allows. Given the correct indexing, tree walks can be performant enough. You wouldn't want me to write the select statement for you, would you? sure I would. why wouln't ask for more explicit help when struggling with the problem for some time? writing a statement that can be analyzed is great help too, especially a query from someone with such big experience compared to mine. the information about hierarchical queries was obvious from the beginning. anyway, if you would like to help here is a complete script that fills table with sample data and expected result: http://geos2005.republika.pl/table.sql http://geos2005.republika.pl/result.jpg GRP column in the table is just helpful for spotting a groups of records but it can not be used in a query. generally the entries in the table are edges of a graph, can be many nodes in a graph, can be connected in any way between each other allowing loops. thank you, geos |
#12
| |||
| |||
|
|
Peter Schneider wrote: Are you then, in turn, going to share part of your pay check with Gerard? ;-) do you think this is the only criteria people help other people? but yes, I would consider that if I knew more details. That is not a database table. It has no primary key, no constraints, no indexes... It is just a dumped Excel table. Any query against it will always do full table scans. it doesn't have to have, because there is no constraints nor primary key. but |
#13
| |||
| |||
|
|
I'm not sure I'll be able to help you. I did understand your original requirements, but now you've lost me. I do not know what "edges of a graph" are. What are columns p and c in your table? What do they contain? |
#14
| |||
| |||
|
|
I strongly disagree. Each table in a relational database has to have at least a primary key [...] [...]If you haven't thought yet about such kind of questions, my guess is that you probably haven't thought deep enough about the entities in real life that your DB is trying to model. |
#15
| |||
| |||
|
|
so, can you solve the problem with pure SQL? thank you, geos |
#16
| |||
| |||
|
|
On Jun 24, 5:46 pm, geos <g... (AT) nowhere (DOT) invalid> wrote: so, can you solve the problem with pure SQL? thank you, geos Can you, and have you tried since posting this originally? David Fitzjarrell |
#17
| |||
| |||
|
|
Can you, and have you tried since posting this originally? David Fitzjarrell |
). I would appreciate any performance improvments hints,![]() |
| Thread Tools | |
| Display Modes | |
| |