February 25, 2008 at 3:45 pm
Hi
This question is not directly related to sql but more to database performance. I am actually creating a dataset in a .net app with about 12 datatables. All of these datatables should have a column that references another datatable called Driver. The thing is each object may have more than 1 driver.
My question is would it be better to create a large Driver datatable that contains references to each of the 12 other datatables or create associate tables for them.
thanks
February 25, 2008 at 4:16 pm
I would create the "glue" tables because I think it would take less memory than storing each driver's data multiple times.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
February 25, 2008 at 4:35 pm
thanks Jack
Is that the option that I should take whenever this problem arises
February 25, 2008 at 9:49 pm
I can really only speak from a SQL Server perspective. If your application is data is like this:
Cars Trucks Drivers
------ ------- -------
Car1 Truck1 Driver1
Car2 Truck2 Driver2
And Driver1 can drive both cars and driver2 can drive car1 and both trucks, then yes I would do tables like:
car_drivers and truck_drivers
----------- -------------
Car1 - Driver1 Truck1 - Driver2
Car2 - Driver1 Truck2 - Driver2
Car2 - Driver2
Rather than a single Drivers table that has:
Car1 - Driver1
Car2 - Driver1
Car1 - Driver2
Truck1 - Driver2
Truck2 - Driver2
In SQL Server I would create a view that combines the driver data using a union query to get these results.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply