There is a large amount of data in the MySQL table, but a summary of the field needs to be read.
For example, this field is primarily used to store articles, and this field of all records for this table is very long.
The efficiency of the Select Title,content from article when querying is much worse than the select title from article.
The previous practice was to read the Content field directly and then use the function to intercept it as a summary of the article.
Now think of a way to save two fields, content fields and content summary fields, but if the content is edited, it needs to be updated to the Content summary field.
What better way to improve efficiency?
Reply content:
There is a large amount of data in the MySQL table, but a summary of the field needs to be read.
For example, this field is primarily used to store articles, and this field of all records for this table is very long.
The efficiency of the Select Title,content from article when querying is much worse than the select title from article.
The previous practice was to read the Content field directly and then use the function to intercept it as a summary of the article.
Now think of a way to save two fields, content fields and content summary fields, but if the content is edited, it needs to be updated to the Content summary field.
What better way to improve efficiency?
I think we should use Redis and other caches to cache the field digest, each time you add or delete the summary of the time, the cache can be synchronized. So put it in the cache and don't check the library. Redis is highly efficient!!!
In fact, you've come up with a way to do it, abstract isolated storage is a good idea.
Introduction of external caches such as redis,memcache, etc.
Comparison of select Title,content and individual select title
1. What kind of table do you have?
2. Need to consider the amount of data transferred, because the data interaction is not only the database work and network card
Select Title,left (content) as description from article
In fact, you already have an answer.