S
S
Scuba2018-08-12 10:51:01
MySQL
Scuba, 2018-08-12 10:51:01

What is the best way to organize a MySQL table?

You need to write down several million blocks with numbers.
There are two options.
1. For each entry, make a separate line in the table, it will look like this:
5b6fe5dc126e0098521149.png
2. Combine the numbers into a line, delimit the blocks with the '|' symbol, and write the numbers themselves through a semicolon. And all this is to put a table with the MEDIUMTEXT type in one line, and process them on the server already during the select: for example, in PHP using explode (). This will be about 1000 times fewer rows in the table.
Then it will look like this:
5b6fe6867a335479306443.png
Which option will work faster if you need to access the table once a minute and extract data for the first case: about 1000 rows, and for the second option - one row.
And how fast will explode work if there are approximately 1000 future array elements in a row?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey, 2018-08-12
@VladimirAndreev

json fields =)

B
bkosun, 2018-08-12
@bkosun

It is correct to do so that the relations in the database are brought to the form corresponding to normal forms. Otherwise, it is not clear why you need a relational database at all?
https://en.wikipedia.org/wiki/%D0%9D%D0%BE%D1%80%D...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question