This is a followup/post question to another question; as I have discovered a solution that has led me to a new problem.
http://stackoverflow.com/questions/2802902/classes-to-entities-like-class-inheritence-problems
We're building this game system, so to speak; and I am using Table Per Concrete Type concept to perform inheritance modeling.
My concern is scalability and performance. I believe I have used a similar technique before and it came out pretty sluggish, but I am not a good DBA, I am a programmer. So I'm very foreign to how this will translate to SQL. But basically it seems to me that it would be slow and weak to have so many 'linked' queries running together. I've posted my schema and entity model for reference. If I can give clearer information, please ask, as I am really not certain what is relevant to 'tuning' this approach.
Sample use would be typical as follows;
static void Main(string[] args)
{
DataContext db = new DataContext();
Character character = new Character()
{
Name = "First",
Ring = new Mapping.Ring()
};
character.Ring.Keys.Add(
new Random()
{
Dice = 2,
Sides = 30,
});
character.Ring.Keys.Add(
new Measure()
{
Maximum = 100,
Minimum = 0
});
character.Ring.Keys.Add(
new Measure()
{
Maximum = 100,
Minimum = 0
});
db.Characters.AddObject(character);
db.SaveChanges();
foreach (Character c in db.Characters)
{
Console.WriteLine(c.Name);
Console.WriteLine(new string('-', 80));
foreach (Measure k in c.Ring.Keys.OfType<Measure>())
Console.WriteLine(String.Format("{0}/{1}", k.Minimum, k.Maximum));
foreach (Random k in c.Ring.Keys.OfType<Random>())
Console.WriteLine(String.Format("{0}d{1}", k.Dice, k.Sides));
}
Console.ReadLine();
}