FK relationship between two non-PK fields?

Posts   
 
    
benles
User
Posts: 62
Joined: 02-May-2005
# Posted on: 15-Oct-2006 02:16:02   

Is this bad design?

Table A Id (PK) Field1 (FK to TableB.Field2)

Table B Id (PK) Field2

I noticed that LLBL will not detect relationships where both sides are non-PK, but in some cases you can avoid a junction table by using a GUID data type in this manner.

Ben

Chester
Support Team
Posts: 223
Joined: 15-Jul-2005
# Posted on: 15-Oct-2006 18:53:31   

Is there a relationship defined between the fields in the database? Is TableB.Field2 unique?

benles
User
Posts: 62
Joined: 02-May-2005
# Posted on: 15-Oct-2006 23:12:00   

Chester wrote:

Is there a relationship defined between the fields in the database? Is TableB.Field2 unique?

Yes. See http://llblgen.com/tinyforum/Messages.aspx?ThreadID=6863&HighLight=1 for info about the non-PK problem.

Chester
Support Team
Posts: 223
Joined: 15-Jul-2005
# Posted on: 16-Oct-2006 03:15:08   

OK, I missed that fact that you were asking an Architecture question. Sorry.

I'm not sure how the design avoids a junction table if the cardinality of the relationship is many-to-many. I've seen the use of bitmaps to do this, but I can't see how guids would be used in this scenario. The bitmap field is stored as an integer, where each bit represents a fact or entity. It can increase performance for intersections with relatively small domains.