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

Home Posts Topics Members FAQ

design question

------=_NextPart_000_03D1_01C3456A.1BA390A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

This question came up at work today, would like to get some fellow =
developer's opinions:

Scenario 1: 2 tables to track checks

in terms of HD space a separate table would have been smaller since the =
checks table grows at 1000+ per week, but there would only be a handful =
of returned checks. In terms of cpu overhead, 90% of ops would have =
gotten a checkid from the checks table and then a search on the actions =
table indexed on checkid. Since there would be few actions per checks it =
shouldn't have been too bad.

CREATE TABLE returned_checks (
returned_checksid int(11) NOT NULL auto_increment,
webm_entityid int(11) NOT NULL default '0',
checkno int(11) NOT NULL default '0',
processed datetime NOT NULL default '0000-00-00 00:00:00',
mirr_isdeleted tinyint(3) unsigned NOT NULL default '0',
timestamp timestamp(14) NOT NULL,
KEY wid (webm_entityid),
KEY rid (returned_checksid)
)=20

CREATE TABLE newpayday_checks (
type varchar(16) NOT NULL default '',
amount float(9,2) unsigned NOT NULL default '0.00',
textamount varchar(128) NOT NULL default '',
name varchar(64) NOT NULL default '',
webm_entityid int(11) NOT NULL default '0',
addr1 varchar(60) NOT NULL default '',
addr2 varchar(60) NOT NULL default '',
citystatezip varchar(70) NOT NULL default '',
country varchar(40) NOT NULL default '',
socialsec varchar(15) NOT NULL default '',
checkno int(11) NOT NULL default '0',
date date NOT NULL default '0000-00-00',
sent datetime NOT NULL default '0000-00-00 00:00:00',
mirr_isdeleted tinyint(1) unsigned NOT NULL default '0',
timestamp timestamp(14) NOT NULL,
paydayfile datetime NOT NULL default '0000-00-00 00:00:00',
stopped datetime NOT NULL default '0000-00-00 00:00:00',
originalcheckid int(11) NOT NULL default '0',
checkid int(11) NOT NULL auto_increment,
checkdate date NOT NULL default '0000-00-00',
KEY name (name,date),
KEY checkid (checkid),
KEY checkno (checkno),
KEY mirr_isdeleted (mirr_isdeleted),
KEY socialsec (socialsec),
KEY webm_entityid (webm_entityid)
) TYPE=3DMyISAM;
Scenario 2: one table to track checks (with a returned date in it)

Reasons behind this are:=20
* less duplication of data and indexes therefore less disk space which =
in turn means less disk IO=20
* less chance of becoming out-of-sync, more data integrity
* less joins (since we'll likely be joining this table) means less cpu =
overhead
* less management, one table to maintain
* one less entry in the mysql table cache (only holds so many)

CREATE TABLE newpayday_checks (
type varchar(16) NOT NULL default '',
amount float(9,2) unsigned NOT NULL default '0.00',
textamount varchar(128) NOT NULL default '',
name varchar(64) NOT NULL default '',
webm_entityid int(11) NOT NULL default '0',
addr1 varchar(60) NOT NULL default '',
addr2 varchar(60) NOT NULL default '',
citystatezip varchar(70) NOT NULL default '',
country varchar(40) NOT NULL default '',
socialsec varchar(15) NOT NULL default '',
checkno int(11) NOT NULL default '0',
date date NOT NULL default '0000-00-00',
sent datetime NOT NULL default '0000-00-00 00:00:00',
mirr_isdeleted tinyint(1) unsigned NOT NULL default '0',
timestamp timestamp(14) NOT NULL,
paydayfile datetime NOT NULL default '0000-00-00 00:00:00',
stopped datetime NOT NULL default '0000-00-00 00:00:00',
originalcheckid int(11) NOT NULL default '0',
checkid int(11) NOT NULL auto_increment,
checkdate date NOT NULL default '0000-00-00',
returned datetime NOT NULL default '0000-00-00 00:00:00',
KEY name (name,date),
KEY checkid (checkid),
KEY checkno (checkno),
KEY mirr_isdeleted (mirr_isdeleted),
KEY socialsec (socialsec),
KEY webm_entityid (webm_entityid)
) TYPE=3DMyISAM;
Which Scenario in your opinion, is better and why?

-Ryan.

------=_NextPart_000_03D1_01C3456A.1BA390A0--
Jul 19 '05 #1
0 2192

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

Similar topics

5
by: Don Vaillancourt | last post by:
Hello all, Over the years as I design more database schemas the more I come up with patterns in database design. The more patterns I recognize the more I want to try to design some kind of...
9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
17
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
19
by: neelsmail | last post by:
Hi, I have been working on C++ for some time now, and I think I have a flair for design (which just might be only my imagination over- stretched.. :) ). So, I tried to find a design...
8
by: indrawati.yahya | last post by:
In a recent job interview, the interviewer asked me how I'd design classes for the following problem: let's consider a hypothetical firewall, which filters network packets by either IP address,...
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,...
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
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...
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: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
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 ...
0
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...

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.