From: dtong123@my-deja.com
Subject: hierarchy table design question
Date: 2000/05/05
Message-ID: <8ev17v$bp0$1@nnrp1.deja.com>#1/1
X-Http-Proxy: 1.1 x33.deja.com:80 (Squid/1.1.22) for client 63.198.187.190
Organization: Deja.com - Before you buy.
X-Article-Creation-Date: Fri May 05 17:43:31 2000 GMT
X-MyDeja-Info: XMYDJUIDdtong123
Newsgroups: comp.databases.theory
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)


Hello,

I have the following table schema:

Table A has 1-M relationship with Table B.
Table B has 1-M relationship with Table C.

I want to get all rows from C by given the primary key of A.
The following is pesudo code from application layer.

1. gets all rows of B by providing primary key of A.
2. for each row of B, gets all rows from C.

U see if I will have 1..n number of rows from B, and I have to loop
through each in order to get rows of C. It is really expensive way for
doing it.

Should I denormalized these tables? .... Any suggestion?
Thanks,
D. T.


Sent via Deja.com http://www.deja.com/
Before you buy.


