Currently, when requesting content from the SAT backend, all content of the desired type(s) is fetched for the requested block range; the results are then filtered after retrieval for the post published by the user(s) we are interested in. This is an artifact of the old in-memory content cache, which only had a single index (block number) on cached content. Since content is now cached in a SQLite DB, we should utilize SQL query capabilities to retrieve only the content in which we are interested in the first place. This will be helpful in debugging, as the logs can get quite verbose in debug mode when query results contain many entries.
Description
Currently, when requesting content from the SAT backend, all content of the desired type(s) is fetched for the requested block range; the results are then filtered after retrieval for the post published by the user(s) we are interested in. This is an artifact of the old in-memory content cache, which only had a single index (block number) on cached content. Since content is now cached in a SQLite DB, we should utilize SQL query capabilities to retrieve only the content in which we are interested in the first place. This will be helpful in debugging, as the logs can get quite verbose in debug mode when query results contain many entries.