Good day.
There is a task to implement a database of goods in MySQL (more than 1,000,000 entries), each product falls into several categories at once. The whole thing is displayed using PHP, on the site for 10-20 products on the page, where the product information indicates which categories this product belongs to.
I am thinking of implementing approximately the following base structure:

categories structure id |name 1 First category 2 Second category 3 Third category ........ items structure id |name 1 First item 2 Second item 3 Third item 4 Fourth item ........ items_categories structure item_id |cat_id 1 1 1 3 2 2 2 3 3 1 3 2 3 3 ........ 

With this method, everything is rendered perfectly with just one query with a JOIN . But here I am afraid for the speed of execution of queries with such a large number of entries in the items_categories table.
Advise if the above structure is suitable, or tell me another way to implement the task. Thank.

    1 answer 1

    This is a classic structure for your case, so it fits.