Search the web
Sign In
New User? Sign Up
baseball-databank · Baseball Databank
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
SCHEMA - Oversized MySQL fields?   Message List  
Reply | Forward Message #3610 of 3880 |
Re: SCHEMA - Oversized MySQL fields?

--- In baseball-databank@yahoogroups.com, "Randy Fiato"
<sysadmin@...> wrote:
>
> I realize that this is a relatively minor detail in relation to
some of the
> other things being planned here, but I've noticed that the current
MySQL
> schema has several fields that are oversized. That is to say, the
fields are
> represented as an integer that is far too large for the possible
range of
> values.
>
> For example, in the Master table, birthYear and deathYear are both
int(4),
> which in MySQL is a 4-byte integer. smallint(4) unsigned (the same
as yearID
> in the other tables) would be better, as this uses only 2 bytes.
Similarly,
> the bith/death days and months could be tinyint(2) unsigned instead
of
> int(2).
>
> Another example that occurs in several tables is that games in a
season (or
> wins, losses, etc.) can be described as tinyint(3) unsigned (range
of 0 -
> 255) instead of smallint(3). I don't think MLB is going to start
playing
> 250-game seasons any time soon. :-)
>
> I've made these changes, among several others, to my copy and have
been able
> to shrink the size of the database by at least a couple of
megabytes (not
> sure of the exact amount).
>
> --
> Randy Fiato
> System Administrator, Big League Forums
<http://www.bigleagueforums.net/>

And to think this is the source of most of my problems. (Well, no,
but I'm trying to add dramatic flair.)

The problem I'm running into is that, to use these values for a lot
of purposes I have to recast them as signed variables. I really
couldn't find any other discussion on these issues - would it be
really inconvenient to change the schema to not use unsigned
variables?

--CW




Sun Oct 19, 2008 3:56 am

wyerscj
Offline Offline
Send Email Send Email

Forward
Message #3610 of 3880 |
Expand Messages Author Sort by Date

I realize that this is a relatively minor detail in relation to some of the other things being planned here, but I've noticed that the current MySQL schema has...
Randy Fiato
rfiato
Online Now Send Email
Jan 1, 2003
12:02 am

... some of the ... MySQL ... fields are ... range of ... int(4), ... as yearID ... Similarly, ... of ... season (or ... of 0 - ... playing ... been able ... ...
wyerscj
Offline Send Email
Oct 19, 2008
12:00 pm

... If the nature of the data is that it is unsigned, it should be stored in an unsigned column. If the nature of your application is that you use the values...
Paul DuBois
pdubois20
Offline Send Email
Oct 19, 2008
4:48 pm

... Anything in baseball that could possibly be a negative number?...
James
emiduplam
Offline Send Email
Oct 21, 2008
9:45 pm

Regarding the tinyint and int and the like issue: I disagree. I'll give you two good reasons: 1. An 8 GB flash drive costs $29. A 500 GB backup drive costs...
Tangotiger
tom@...
Send Email
Oct 22, 2008
1:20 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help