Now there is a need to put the user comments in the picture automatically categorized as user photo album to facilitate other users to browse, previously there is a picture address in the database, if every time you view the album will query the database, now want to go directly through the User album folder below the picture to browse the album, which Way is better? I wonder if the gods can understand?
Reply to discussion (solution)
Suggest you still do in the way of the previous, picture address in the database inside. The picture is saved in the hard drive. But you need to associate the picture with the user.
To traverse the user album folder, is it difficult for each user to build a folder?
Suggest you still do in the way of the previous, picture address in the database inside. The picture is saved in the hard drive. But you need to associate the picture with the user.
To traverse the user album folder, is it difficult for each user to build a folder?
Now the tangled time if the table data is large, then the query is not very slow, if the folder traversal should be more quickly
Storing the image address in JSON extension
Storing the image address in JSON extension
What do you mean? Can you explain the white point? Images are stored in JSON format in the database?
Query the database every time you view the album.
This is normal, the database is to do this, tired not to die
If the table data is large, then the query time is not very slow
Do you take it for granted?
Make an index to the user ID at most
It should be quicker to traverse the folder.
It's taken for granted!
A database query is made in a file, and the folder traversal is done on the hard disk.
You say that fast?
Query the database every time you view the album.
This is normal, the database is to do this, tired not to die
If the table data is large, then the query time is not very slow
Do you take it for granted?
Make an index to the user ID at most
It should be quicker to traverse the folder.
It's taken for granted!
A database query is made in a file, and the folder traversal is done on the hard disk.
You say that fast?
Thanks to the moderator's answer, the user ID is indexed. I know how to do it. Thanks a lot!
Storing the image address in JSON extension
What do you mean? Can you explain the white point? Images are stored in JSON format in the database?
Yes