xiao Posted January 10, 2008 Share Posted January 10, 2008 e.g.: I have 2 tables: 'job' & 'employer' Job contains stuff like description, title, type, ... Employer contains name, address, ... I want to show the employer in my job description. I can do 2 things: - Store the name of the employer in the 'job' table - Store the employer's id in the 'job' table and get the employer's name from another query. the 2nd option saves space and is the right way to do this, but doesn't it take more time for the page to load when I do this? Since it's an extra calculation. Link to comment https://forums.phpfreaks.com/topic/85402-db-optimization/ Share on other sites More sharing options...
teng84 Posted January 10, 2008 Share Posted January 10, 2008 maybe yes but it takes more time to load when your DB is crowded. it takes more time to query on one single table having huge data than querying some tables having less data (normalization) Link to comment https://forums.phpfreaks.com/topic/85402-db-optimization/#findComment-436021 Share on other sites More sharing options...
fenway Posted January 11, 2008 Share Posted January 11, 2008 Don't even consider *not* storing the ID. Link to comment https://forums.phpfreaks.com/topic/85402-db-optimization/#findComment-436698 Share on other sites More sharing options...
xiao Posted January 11, 2008 Author Share Posted January 11, 2008 I always store IDs, even if I don't plan to use them at first. Link to comment https://forums.phpfreaks.com/topic/85402-db-optimization/#findComment-436793 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.