Answer the question
In order to leave comments, you need to log in
How to increase performance of MySQL music library database?
Hello. I ask for advice. There is a task, you need to increase the performance of the database (MySQL) without changing the architecture (the architecture is like 2 fingers).
There is a music library website, the functionality is also like 2 fingers, you can register, download songs, listen online, the admin can delete songs.
The base consists of 2 tables.
Users table (id, first name, last name, nickname, email, password, birthday, city, university, faculty)
Music table (id, artist, song_name, duration, genre, album, year, link_where_downloaded_song is located).
I found this theory on the internet:
Multimedia files, whether they are static images, sound files, or movies, are often treated as binary objects. There is even a special term for them: BLOBs (Binary Large OBjects). BLOB fields can be stored either in the database or in the file system. In the latter case, the paths to the BLOBs are stored in the database. Storing BLOBs in the file system will require a little more work from you, but will allow you to achieve much better performance than storing them in a database.
Answer the question
In order to leave comments, you need to log in
Well, in fact, without changing the architecture, you can only optimize by playing with indexes. Therefore, look at what queries you are using (which fields are used in the filter) and make optimal indexes for them.
For example, if you have a filter by genre, year and album, then you should have a query:
and the corresponding index:
And note that the order is important , so all your queries must have a strictly specified order in the index!
Such a query will use only part of the index.
Well, read other subtleties about indexes, actually an interesting problem)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question