I have a master table (tbl_track) which has approx 22million records in it. I also have a number of subtables, such as tbl_optional, tbl_bearing, etc which contain data relating to the tbl_track table. I have a unique record number assigned to each record in tbl_track, and this is the primary key in this table.
All the subtables have a foreign key which matches the primary key in the tbl_track table. However I have found that when I perform a join just between these 2 tables to return about 16 fields (6 from tbl_track and 10 from tbl_bearing), the select query is taking a little over a minute to execute, but I can query each table indivually in under a second.
What am I doing wrong???!
Cheers,
Matt
All the subtables have a foreign key which matches the primary key in the tbl_track table. However I have found that when I perform a join just between these 2 tables to return about 16 fields (6 from tbl_track and 10 from tbl_bearing), the select query is taking a little over a minute to execute, but I can query each table indivually in under a second.
What am I doing wrong???!
Cheers,
Matt