Answer the question
In order to leave comments, you need to log in
How to properly organize the storage of category links with a post?
Good afternoon. I got one project on DLE in which there are many categories and posts.
I looked at a selection of category posts, it looks like:
SELECT * FROM dle_post WHERE category regexp '(17)'
JOIN categories_to_post ON dle_post.post_id = categories_to_post.post_id WHERE categories_to_post.categoiry_id = 'ид категории'
Answer the question
In order to leave comments, you need to log in
also how to reduce
only the inner join (if you need posts from this category)
+ if there are a lot of records, then you will need to create indexes for
dle_post.post_id
and for the link table
categories_to_post.post_id
categories_to_post.categoiry_id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question