I think I killed MySQL?

0 like 0 dislike
3 views
Good morning.
Decided to make a test database with 500k rows.
Structure:
[id | post_id | text | time]
post_id is a number in the for loop ($i = 0; $i < 1000000; $i++)
time - function time () in PHP
Query: SELECT * FROM `test`; - result:
....................*here is the previous lines*.................... | 579777 | 579776 | text | 1524706021 | | 579778 | 579777 | text | 1524706021 | | 579779 | 579778 | text | 1524706021 | | 579780 | 579779 | text | 1524706021 | | 579781 | 579780 | text | 1524706021 | | 579782 | 579781 | text | 1524706021 | | 579783 | 579782 | text | 1524706021 | | 579784 | 579783 | text | 1524706021 | | 579785 | 579784 | text | 1524706021 | | 579786 | 579785 | text | 1524706021 | | 579787 | 579786 | text | 1524706021 | | 579788 | 579787 | text | 1524706021 | | 579789 | 579788 | text | 1524706021 | | 579790 | 579789 | text | 1524706021 | | 579791 | 579790 | text | 1524706021 | | 579792 | 579791 | text | 1524706021 | | 579793 | 579792 | text | 1524706021 | | 579794 | 579793 | text | 1524706021 | | 579795 | 579794 | text | 1524706021 | | 579796 | 579795 | text | 1524706021 | | 579797 | 579796 | text | 1524706021 | | 579798 | 579797 | text | 1524706021 | | 579799 | 579798 | text | 1524706021 | | 579800 | 579799 | text | 1524706021 | | 579801 | 579800 | text | 1524706021 | | 579802 | 579801 | text | 1524706021 | | 579803 | 579802 | text | 1524706021 | | 579804 | 579803 | text | 1524706021 | | 579805 | 579804 | text | 1524706021 | | 579806 | 579805 | text | 1524706021 | | 579807 | 579806 | text | 1524706021 | | 579808 | 579807 | text | 1524706021 | | 579809 | 579808 | text | 1524706021 | | 579810 | 579809 | text | 1524706021 | | 579811 | 579810 | text | 1524706021 | +--------+---------+------+------------+ 579811 rows in set (38.90 sec)

Make a request:
SELECT * FROM `test` WHERE `post_id`>1 AND `post_id`<100
the result:
| 84 | 83 | text | 1524705788 | | 85 | 84 | text | 1524705788 | | 86 | 85 | text | 1524705788 | | 87 | 86 | text | 1524705788 | | 88 | 87 | text | 1524705788 | | 89 | 88 | text | 1524705788 | | 90 | 89 | text | 1524705788 | | 91 | 90 | text | 1524705788 | | 92 | 91 | text | 1524705788 | | 93 | 92 | text | 1524705788 | | 94 | 93 | text | 1524705788 | | 95 | 94 | text | 1524705788 | | 96 | 95 | text | 1524705788 | | 97 | 96 | text | 1524705788 | | 98 | 97 | text | 1524705788 | | 99 | 98 | text | 1524705788 | | 100 | 99 | text | 1524705788 | +-----+---------+------+------------+ 98 rows in set (27.52 sec)

I think that is sooooo much to output 100 rows, how to optimize MySQL itself? (it should be MYISAM)
Parameters:
1CPUx2400MHz
512MB RAM
10GB SSD
by | 3 views

1 Answer

0 like 0 dislike
by
110,608 questions
257,186 answers
0 comments
33,909 users