The question is quite straightforward. I can’t choose between either. In the dev documents MySQL has specified that indexes can pick a row from it’s position rather than searching the whole table.
Suppost i have a request to fetch the 20 best posts in my Posts table based on the ratings. Should i just cache the id‘s of the retrieved Posts or Should i cache the whole results for responding further requests.
Btw i’m using file based caching.
Memory is cheap and caching 20 rows usually don’t take up much.
I would say: Cache the full rows if it isn’t data that have a requirement to be fresh.