473,473 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Database & DB Size Question

I have two distinctively different pieces of equipment that I'm trying
to build a database for, each having 20 inputs which makes my mysql
table 40 fields wide.

Form one is for 'shakers' and form two is for 'conveyors'. About the
only thing they will have in common is that they both share
'motorsize' and they both share 'bearing' although shakers have two
where conveyors have four.

I'd first built a table within a database called 'equipment' just for
shakers and and planned on doing another one called 'conveyors' to
capture contents from the conveyor form.

The reason I'd thought about placing inputs from both forms into a
single table was for better queryability from a single query form
where I'd be sure to capture even common elements such as where all I
use a particular 'bearing' without having to query each table
separately.

I noticed immediately that inputting data from my 'shakers' form was
not successful after I'd set the table up with 40 fields to capture
activity from both forms which maybe I could correct by adding <input
type="hidden" name="whatever" value="0"> as appropriate to fill up the
additional 20 fields for each respective form but that might be an odd
way to do it, not to mention what the database size might look like
down the road.

So, should I run input data from two twenty input forms into a table
of 40 fields or will the size grow so quickly that I am fast to regret
it.

thanks for any advice,

Chris
Dec 9 '05 #1
4 1556
In message <54********************************@4ax.com>, cover
<co****************@yahoo.com> writes
I have two distinctively different pieces of equipment that I'm trying
to build a database for, each having 20 inputs which makes my mysql
table 40 fields wide.

[Snip]

a) First step is to ignore for now that you are using any particular
database, and simply look at the data. Create a list of the real world
things you have to record information about, and, against each, list the
single value properties that you must record.

Then add any events that can happen, that you are interested in, and the
information (again, single values) you need to keep about those events.

I expect these are motors, conveyors and shakers, and perhaps repairs,
sales, modifications, tests, etc.

b) Normalise the data. This means remove *ALL* duplication and
repetition.

There is a single logical place for everything, and everything has
exactly one logical place that it could go.

Any conceivable change to a data value, involves just a SINGLE data
field changing. e.g. If a motor's max operating temp changes, it must be
changed in the data you store about a type of motor, not with the data
about the motor's use, repair, purchase, test log etc. Neither should
max operating temp be stored with the conveyor table against the motor
you are using.

Although blank fields are permitted, you will find they usually mean you
are missing data. If not, treat this as a warning that you have it
wrong.

Repetition involves creating another table in almost all cases. You CAN
avoid it if the repetition is always exactly some small number, and you
know this will have to be true for all future objects of this type, even
those that have not yet been designed, thought up, or conceived of yet.
Even then you are taking a risk. Remember in the database you are trying
to record the real world as it is in all its variety. Validation is for
the programming, not the database!

c) Now you create your database design. Objects and Events map to
tables. Properties become fields. If you have any difficulty with this,
go and do step b properly!

d) Build the system. Test it. Stress test it. Is it fast enough? It
probably will be.

e) If, and only if, some operations you need to do are not fast enough,
the next step is to instrument your code and discover where, exactly the
bottle neck is. Until you now exactly what is taking the time, and why,
all you have as a guess. Such guesses are near useless even with a lot
of experience.

f) If you have proved the problem is in the database, you may consider
your options. Some ideas

1) Spend $150 throwing memory at the problem.
2) Spend $400 throwing a fast SCSI disk at the problem.
3) Consider how the slow operation is performed, and approach it in
another way. This may be as simple as doing a sub operation against
every row in a table to fool the optimiser into doing the job
efficiently. In the worst case I know of, it involved creating a
temporary table that was then processed in a new order, and discarded
when the job was complete. Cost - a week or two without one program -
say $3000.
4) Spend a month ($10000?) working out how to change the tables, and
where to update multiple fields, to de-normalise the data, and making
the changes, and then another $10000 sorting out the bugs you just
created. Ask your manager to estimate the opportunity cost of being 2
months late, and factor that cost in also, before you go this route.

Hardware is cheap and getting cheaper. People are expensive and getting
more costly. You are trying to make things hardware efficient to save a
few milliseconds. What you will achieve is making things confusing for
people and that will cost a lot in delay and future maintenance costs.

Regards

Ian

--
Ian - posting to a Newsgroup. Please remove everything to reply.
Dec 11 '05 #2
On Fri, 09 Dec 2005 08:44:14 -0800, cover wrote:
I have two distinctively different pieces of equipment that I'm trying
to build a database for, each having 20 inputs which makes my mysql
table 40 fields wide.

Form one is for 'shakers' and form two is for 'conveyors'. About the
only thing they will have in common is that they both share
'motorsize' and they both share 'bearing' although shakers have two
where conveyors have four.

I'd first built a table within a database called 'equipment' just for
shakers and and planned on doing another one called 'conveyors' to
capture contents from the conveyor form.

The reason I'd thought about placing inputs from both forms into a
single table was for better queryability from a single query form
where I'd be sure to capture even common elements such as where all I
use a particular 'bearing' without having to query each table
separately.

I noticed immediately that inputting data from my 'shakers' form was
not successful after I'd set the table up with 40 fields to capture
activity from both forms which maybe I could correct by adding <input
type="hidden" name="whatever" value="0"> as appropriate to fill up the
additional 20 fields for each respective form but that might be an odd
way to do it, not to mention what the database size might look like
down the road.

So, should I run input data from two twenty input forms into a table
of 40 fields or will the size grow so quickly that I am fast to regret
it.

thanks for any advice,

Chris


Ian Holison put it better than me, but basically if your fields are
growing towards the 20plus mark it is almost certain that you have the
table the wrong way round. In that the fields should be records. Chances
are if you have 40 fields then at some time they will be 41, so you have
to plough through every query/report/form that makes use of that table.

Don't worry about multi-table queries, the modern engines cope with these
very well.

The tricky part is deciding what information links the various parts of
the data, which is basically what Ian is describing to you. I don't do
contract programming any more, but when I did a typical 8 months contract
for a database application, the first two months tends to be concerned
with the data alone, making sure you know how the data is used, playing
with it on paper moving fields around, normalising it.

I even did one database where they gave me spreadsheets, many spread
sheets, with many thousands of records they had built up over many years,
fields stretching from 'A1' to something like 'DD1'. It turned out from a
quick play that a great deal of that data was static, that then became a
much reduced link table, with a couple of tables no more than 5 fields
each for the changeable data.
Dec 12 '05 #3
On Sun, 11 Dec 2005 20:25:30 GMT, Ian Hobson
<Ne*******@ntlworld.everything.com> wrote:
In message <54********************************@4ax.com>, cover
<co****************@yahoo.com> writes
I have two distinctively different pieces of equipment that I'm trying
to build a database for, each having 20 inputs which makes my mysql
table 40 fields wide.

[Snip]

a) First step is to ignore for now that you are using any particular
database, and simply look at the data. Create a list of the real world
things you have to record information about, and, against each, list the
single value properties that you must record.

Thanks Ian - appreciate your help very much.
Jan 2 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Geoff Cox | last post by:
Hello, Can I separately declare and initialize a string array? How and where would I do it in the code below? It was created using Visual C++ 2005 Express Beta 2 ... In C# I would have ...
2
by: Chris Becker | last post by:
This is my attempt to rephrase a question I asked earlier that got no response. I suspect it was my poor/unplanned wording. Here is another attempt: I have a form with some drop down lists. I...
26
by: Jimmy | last post by:
ill have a database with 1 table and 3 fields: ID FIRSTNAME LASTNAME (the ID field will be the auto incrementing index) there might be 10 records in the DB, there might be 10,000. i...
14
by: Bryan Parkoff | last post by:
Do you know that current C++ Compiler limits to 64KB segments in source code? It is good news that Microsoft Visual C++ 2005 has expanded to 4GB segments in source code. 4GB segment is ideal for...
0
by: sala | last post by:
this is my programm, there is a mistake because it doesn't give the right answer; the quetion is below the program: #include<stdio.h> #define maxsize 100 void fillarray(double*, int); void...
39
by: dancer | last post by:
Can somebody tell me why I get this message with the following code? Compiler Error Message: BC30452: Operator '&' is not defined for types 'String' and 'System.Web.UI.WebControls.TextBox'. ...
1
by: inamul | last post by:
I want to select CheckBox based on data retrieved from mysql database table. Could anyone show me the simple way of doing it. Data store in table under colum "sectionOfInterest" is shown below...
1
by: Brit | last post by:
I have an ASP file that retrieves names from an Access database for 4 different categories of membership, which the visitor to the page selects (corporate, institutional, regular, or student). The...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.