Sunday, 31 January 2010

Best laid plans...

Well, that didn't get far.

It looks like there's a small problem in the F1 Sweepstake schema - and I'm unsure at the moment just how much of a pain it will be. At the heart of the problem is that I've decided to partition the data on a season basis, therefore at the "top" of the tree is a season table which holds little more than a year number and a flag for the "current season". Everything which is an actual instance of something (e.g. race, result) refers to it by season, but also may refer to more "static" information (e.g. a race is at a circuit - but the circuit crosses seasons, or a result was for a seat which had a driver - but the driver may have been in more than one season).

All very well and good, except I didn't really link the competitor (those participating in the sweepstake) in the same way, or even really think about it - thus while you can easily join from the "formula 1 season" data into the "sweepstake data", via the natural identity links and season partitioning, you cannot so easily go the other way around. Which, will, err, kinda be required for managing the competitors - d'oh!

OK, so I can just slap the season partitioning on the tables linking the competitor's choices to the rest of the app and hopefully all will be well... maybe. Something is bugging me about the EDM editor where it keeps picking up a weird reference into one table, but not a similar reference into another "logically identical" table - now that was partly caused by a missing FK reference, but it kept coming back long after the reference was instated.

Then again, maybe I'm just being slightly paranoid (as schema changes can be expensive and painful), and that I can't quite think of the best way to do it at the moment.

Need to have a ponder, and tinker around with it.

No comments:

Post a Comment