473,888 Members | 2,194 Online
Bytes | Software Development & Data Engineering Community
+ 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 1576
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*******@ntlw orld.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
5340
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 private string myArray;
2
3632
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 would like the user to be able to start filling in the form, then get to one of the dropdown lists (ex: Service Type) and realize that the dropdown list does not contain the entry that they need. So next to the Service Type drop down list is a...
26
3170
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 need to open the DB and randomly select a record (and then display the name, which i dont have a problem with) how can i randomly select a record? im guessing id have to open a recordset
14
1964
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 large object using pointer to function and switch. Please list other C++ Compilers if they have added a support of 4GB segments. I am able to write 65,536 functions and 65,536 function's memory address is stored into pointer to function list. ...
0
1155
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 getminmax(double*, double*, double*, int); int main() { double WinNum, WinP, grades; int size,num,i; printf("\n how many players are there:"); scanf("%d", &size);
39
4752
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'. <html> <head> <% @Import Namespace="System.Web.Mail" %>
1
1797
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 ------------------------------------------------------------------------ "Commercial Security Middle East, Homeland Security and Policing Middle East,Safety & Health Middle East, "...
1
2366
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 DNS name is "cati", the names are specified in the "Last_names" field, and the categories are in the "categories" field. l want the results sorted in alphabetic order by last name. However, the results appear to be in a totally random,...
0
9957
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9799
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11173
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10878
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10434
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9593
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6011
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4635
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 we have to send another system
3
3245
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.