H
H
hdtor2017-05-21 20:42:28
MySQL
hdtor, 2017-05-21 20:42:28

Is the database structure correct?

Good evening.
There is a task to create a simple site with a very large number of articles - about 2 million articles. The site is the simplest without the admin panel working in conjunction with the database. There was a question of the correct organization of a DB. The main task is the fast work of unloading data from the database.
Now I have the following database structure, as a result there will be 3 tables in the database.
The first table is categories, respectively categories of articles.

Структрука таблицы categories:

id - соотвественно id категории
name - название категории

Next, the posts table will contain the following cells:
id - id записи
name - название статьи 
catid - id категории (из таблицы categories)
min_descr - краткое описание статьи
views - количество просмотров статьи
meta_keywords - ключевые слова для meta_keywords
meta_descr - краткое описание для meta_description

And the last table texts - will contain the texts of the article, the following structure:
id - id записи
postid - id статьи (связка с таблицей postid), будет стоять индекс на это поле.
text - сам текст статьи, поле будет - LONGTEXT

I plan all tables by type InnoDB
Everything. Now the question is whether such a structure will work quickly with 2 million records? What are the suggestions for improvement? The main thing is a quick selection from the database when displaying the title, records, texts, etc. Share your opinion please. Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Night, 2017-05-22
@maxtm

It will be, for mysql 2 million records is not a problem.
Another question - what kind of traffic? If it's 100-150 requests per second - then no problem at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question