SupaMonkey Posted May 23, 2006 Share Posted May 23, 2006 Ok, so I am gonna jack up my product catalogue script a bit as it is getting slightly outdated. One of the new features is "Other related products"Now, my question is, which would be better:1) Adding a column to a products "related_products" and just put csv ID's of other products in there and just explode,etc. whenever i need them2) Create a new table and create a new record for every related product for each product3) Something else you guys may think of?My worthless-based-on-nothing impressions are:1) Would be faster, more efficient2) Would be easier to make initially, but slower/less efficientAny takes on this or any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/10249-tablecolumn-optimisation-enquiry/ Share on other sites More sharing options...
Barand Posted May 23, 2006 Share Posted May 23, 2006 No contest - use a separate table.If you have a csv field of id's you can't join those ids to the product file to get descriptions etc of the related products.[code]product related_prods---------- --------------prod_id <----+ rec_id description |price +--- prod_id | +--- rel_prod_id[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10249-tablecolumn-optimisation-enquiry/#findComment-38342 Share on other sites More sharing options...
SupaMonkey Posted May 24, 2006 Author Share Posted May 24, 2006 Couldnt I just retrieve the CSV column then explode it, then loop through it and get each id's data with a query? Quote Link to comment https://forums.phpfreaks.com/topic/10249-tablecolumn-optimisation-enquiry/#findComment-38502 Share on other sites More sharing options...
Barand Posted May 24, 2006 Share Posted May 24, 2006 Yes. You could go the whole hog, uninstall MySql and just use a text file. Quote Link to comment https://forums.phpfreaks.com/topic/10249-tablecolumn-optimisation-enquiry/#findComment-38685 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.