A
A
Alexander2019-11-25 12:11:15
MySQL
Alexander, 2019-11-25 12:11:15

How to unload a large database?

There is a database on mysql, it has a table with a million+ rows, now a banal query for a select by 1 parameter works for more than 3 seconds, but we make long queries with join with calls to a number of tables, as a result, the user waits for one module to be loaded by 5 -7 seconds.
Tell me how you can reduce the load and increase the speed of queries, subject to optimized code and queries.
You can just link to articles (I searched, did not find).

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Mikhail Bobkov, 2019-11-25
@AleksandrB

Are there indexes on the parameters of the sample?
Such a time for a simple select on relatively small data shows that most likely not.
What does the explain query produce?

T
ThunderCat, 2019-11-25
@ThunderCat

this is a purely exemplary request, but since I am a complete layman in sql, please explain what is wrong in it.

Tell me how you can reduce the load and increase the speed of queries, subject to optimized code and queries.
Under the condition of optimized code and queries, there will be approximately no load, since, judging by the presented explain, they are far from "optimized" in your case.

I
Ivan Melnikov, 2019-11-25
@immelnikoff

What is the nature of the load on the database (read / write)?
Do all fields have the smallest sufficient data type?
Is the server set to a minimum sufficient transaction isolation level?
Are queries optimized for "greed"?

V
Vladimir Korotenko, 2019-11-25
@firedragon

In general, create indexes in problem areas, optimize / de-optimize the database, reorganize the query
https://dev.mysql.com/doc/refman/8.0/en/explain-ou...
https://habr.com/en/ post/211022/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question