Which is more efficient

E

Ed Richter

I'm creating an Access database for a website and I'm in process of making a table. I'm creating an availability schedule where members (around 80) would state if they are available on pre-determined nights.(2 months worth of dates) My table could either consist of 80 records (one for each member) and each record would have 60 fields (one field for each date); or could write to database for each date person's available on separate record therefore table would have two fields, one name and one date field, but would have approx 60 records for each person (80 people) for a total of around 4800 records.

I'm wondering if one method is alot more efficient than the other?
 
T

Thomas A. Rowe

Ed,

It is more a matter of how you want to retrieve or use data later, which drive you to the best way
to store the data.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================


I'm creating an Access database for a website and I'm in process of making a table. I'm creating an
availability schedule where members (around 80) would state if they are available on pre-determined
nights.(2 months worth of dates) My table could either consist of 80 records (one for each member)
and each record would have 60 fields (one field for each date); or could write to database for each
date person's available on separate record therefore table would have two fields, one name and one
date field, but would have approx 60 records for each person (80 people) for a total of around 4800
records.

I'm wondering if one method is alot more efficient than the other?
 
E

Ed Richter

The 4800 record method would probbably put it in a better format for me to
use later. But was wondering if I'm going to take a performance hit in doing
so?
 
T

Thomas A. Rowe

Can you explain how you plan to use/display the data?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
M

MD Websunlimited

Hi Ed,

The number of records will normally not effect how the records are accessed provided the data is normalized and appropriate indexes are created to access the records efficiently.

With an index, access to each record would be about the same whether the record is the first record or the last record as it would have to read 'n' index pages to locate the record and then a single access to retrieve it. So if the depth of the index where 2 it would take at most 2 index reads and 1 record read to get any record in the database.

As for the layout of the database, normalization will decide that for you. In your case, I would create two tables:

Table one would hold the member Information and the primary index key would be member id, e.g.,

MemberID -- primary key
Salutation
FirstName
LastName
Address1
Address2
City
State
Zip
Title
Phone
Fax

Table two would be a table of members available dates with the primary index key being the member id and a secondary one on available date

AvailDate - secondary key
MemberID - primary key


Why two tables? First and foremost it normalizes the data and second it will provide for a cross tab query of the data, that is, if I need to know which members are available on a specific date I can query Table two for the date then reference the member information for the details of the member.


A note on normalization -- normalization is the process of taking data fields and grouping them based on like dependencies. There are three levels of normalization with 3rd normal form being the goal. Once you have the data in third normal form you can then create the database tables and decide if you need additional indices for efficient access to the data based upon the application.

HTH,


--
Mike -- FrontPage MVP '97-'02
J-Bots 2004 Released Special Pricing
http://www.websunlimited.com
FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible



I'm creating an Access database for a website and I'm in process of making a table. I'm creating an availability schedule where members (around 80) would state if they are available on pre-determined nights.(2 months worth of dates) My table could either consist of 80 records (one for each member) and each record would have 60 fields (one field for each date); or could write to database for each date person's available on separate record therefore table would have two fields, one name and one date field, but would have approx 60 records for each person (80 people) for a total of around 4800 records.

I'm wondering if one method is alot more efficient than the other?
 
M

MD Websunlimited

Thomas,

This is very bad information.

Database design does not depend upon that criteria, instead the data should be normalized down to 3rd normal form which will be the
basis of the database tables required to store the data.

Once that is accomplished, you can then add indices, backend procedures etc. that work with how you are retrieving the data and
using the data in the application. All of which make the data access more efficient.
 
T

Thomas A. Rowe

Mike,

"This is very bad information." I disagree.

How you plan to use the data, will depend on how you have the data stored and you actual state that
below as well in a round about way.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================


MD Websunlimited said:
Thomas,

This is very bad information.

Database design does not depend upon that criteria, instead the data should be normalized down to
3rd normal form which will be the
basis of the database tables required to store the data.

Once that is accomplished, you can then add indices, backend procedures etc. that work with how
you are retrieving the data and
 
Top