Re: MySQL speed issue

by gchurchman(at)medseek.com (Gary Churchman)

 Date:  Thu, 30 Mar 2000 08:33:00 -0800
 To:  <Cetaces(at)aol.com>,
<hwg-techniques(at)hwg.org>
 References:  aol
  todo: View Thread, Original
There are a lot of different answers to this question depending upon the
type of data.  In all cases, data should be "normalized" according to the
way you want to search results from the database.  If your database contains
names, addresses and phone numbers, for example, and each name might have
multiple addresses and/or phone numbers, you probably want to have a minimum
of three tables:  One containing names, one containing phone numbers, and
one containing addresses.

The one containing names should have a primary key that is included in the
insert query for each pertinent address and phone number record in the other
two tables.  The select query would then join the three tables based upon
that key.  The table design speeds the process by minimizing the need to
reread records for each looped operation.  It would read the name only once
and gather all of the addresses and phone numbers that relate to the name.
This is a terribly simplified example, but may be helpful.

Gary Churchman
Director, Production and Design
MedSeek
gchurchman(at)medseek.com
www.medseek.com


----- Original Message -----
From: <Cetaces(at)aol.com>
To: <hwg-techniques(at)hwg.org>
Sent: Thursday, March 30, 2000 7:14 AM
Subject: MySQL speed issue


> I have been learning MySQL and was wondering if a query would retreive
data
> faster if  all information was in one table as opposed to multiple tables?
I
> would help to know this in order to better design my table structure.
>
> Thanks, Stephen.

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA