Jump to content

Table/Column optimisation enquiry


SupaMonkey

Recommended Posts

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 them
2) Create a new table and create a new record for every related product for each product
3) Something else you guys may think of?



My worthless-based-on-nothing impressions are:
1) Would be faster, more efficient
2) Would be easier to make initially, but slower/less efficient

Any takes on this or any suggestions?
Link to comment
https://forums.phpfreaks.com/topic/10249-tablecolumn-optimisation-enquiry/
Share on other sites

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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.