开发者

Saving a large text chunk in a mysql table

开发者 https://www.devze.com 2023-04-10 04:19 出处:网络
I\'m building a music site. It has a lot of artists and tracks stored. I\'m planning to retrieve artist information from Wikipedia and store it on my server - somehow.

I'm building a music site. It has a lot of artists and tracks stored. I'm planning to retrieve artist information from Wikipedia and store it on my server - somehow.

Would i want to save this as static files? In the artists table? In a separate table so it wont be loaded ev开发者_JS百科erytime i load a track, for example?

Selecting only certain columns is too much work at the moment, due to the amount of querys on the site, but i will look into that later. Promise.


I would store the text as a text object in your db. Since it's an attribute of the artist, store it as such. If you don't need it for some queries, don't select it - I know you say this is too much work - it isn't, it's easy. If you store it in a separate table, you will be making a join when you query and that is probably unnecessary. If it was a video file, I would suggest storing it outside the db, but relatively speaking a large text object is nothing.


you should store it in another table, keep your tables small.

you wont need any join statement to get to the data when you want it, you can do it like this:

SELECT wiki

FROM

bios as b,
artists as a

WHERE

a.ID=b.ID
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号