IMTheNachoMan
IMTheNachoMan

Reputation: 5821

store hierarchy information in a MS Access DB for faster queries

I'm trying to figure out how I can store hierarchical type information in a MS Access DB so that queries will be faster. An use case example might make more sense.

At this point:

But it can be very slow. Especially if my joins get complex.

So I thought maybe there is a way to create another table that would all the hierarchies and it would maintain parent/child relationships and the first table would reference a row in it. And then, somehow, I could use it to find rows in the first table that match hierarchies and sub-hierarchies in the second table.

However, I have no clue if this is even possible and how I would go about it. Any advice is appreciated.

Upvotes: 0

Views: 821

Answers (1)

hetOrakel
hetOrakel

Reputation: 1680

In Oracle we use the hierarchal structure where each row has a reference to its parent. Then with the CONNECT BY clause you can connect these rows to each-other.

You should take a look here: simulation of connect-by in sql-server

Upvotes: 1

Related Questions