List:General Discussion« Previous MessageNext Message »
From:Steven Staples Date:March 30 2010 3:36pm
Subject:Table Length Question...
View as plain text  
Hi there,

I currently store some information about a users daily habits in a table.
The table has 4 fields per day, and another 4 fields as the keys.  This
table, depending on the month, can be from (4 keys + (28 days * 4 fields per
day)) fields, to (4 keys + (31 days * 4 fields per day)) fields long... 

The table layout is like such:
+-----+---+----+-----+------+------+------+------+------+------+------------
--
|name |id |id2 |type |d01f1 |d01f2 |d01f3 |d01f4 |d02f1 |d02f2 |.....and so
on
+-----+---+----+-----+------+------+------+------+------+------+------------
--

Performance wise, would it be better to have it laid out in a manner such as
+-----+---+----+-----+----+---+---+---+---+
|name |id |id2 |type |day |f1 |f2 |f3 |f4 |
+-----+---+----+-----+----+---+---+---+---+
So that each row, contains a single days details, rather than have a single
row, contain the entire months details?

Also, when i would do a select, if i wanted say d02f1, would it load the
entire row first, and then just give me that field?
-Select `d02f01` from `mytable` where [where clause]
Or would it jsut load that field... 

Does these questions make sense?  (they do in my head)

Steven Staples


Thread
Table Length Question...Steven Staples30 Mar
  • RE: Table Length Question...Gavin Towey30 Mar
  • Re: Table Length Question...Chris W30 Mar