Re: Whats more efficient?

From: Kristian Damm Jensen <kristian-Damm.Jensen_at_REMOVEcapgemini.dk>
Date: Fri, 30 Mar 2001 09:29:16 +0200
Message-ID: <3AC435CC.4544BDB7_at_REMOVEcapgemini.dk>


Tom wrote:
>
> I am working on a database that is being used for user authentication on a
> web site. I'm trying to figure out the most efficient way to lay out the
> table(s). Here is how its currently arranged:
>
> PERMISSIONS(UserId[pk], Area1, Area2, Area3, etc..)
>
> There is a record for each user, each area is a boolean y/n data type. I
> dont really think this is the most efficient way, because there are alot of
> null values (not all users have access to all areas).
>
> Because the relationship of users to areas is M:M, would it be more
> efficient to break the above into the following two tables?
>
> AREA(AreaId, blah, blah, etc..)
> PERMISSIONS(UserId, AreaId) <--Intersection Table

Definitely, yes.

--
Kristian Damm Jensen              | Feed the hungry. Go to 
kristian-damm.jensen_at_capgemini.dk | http://www.thehungersite.com
Received on Fri Mar 30 2001 - 09:29:16 CEST

Original text of this message