Add local column to actions tables
The column would be true if the person is local, i.e. if the action came from the local instance. This would make some joins and/or sub-selects unnecessary, and it's consistent with other tables. If this really is an improvement, then I will make the necessary changes to uplete, so it can handle a column that is both outside of the key and not null even after removing all actions.
https://github.com/LemmyNet/lemmy/pull/5616#discussion_r2070695597
Wouldn't it be much easier to just do a periodic job (it could even be daily), to clear out empty actions rows, rather than adding all this special uplete logic?
The empty rows are harmless anyway (since front ends will have to check that column), and space is the only consideration there. That can easily be solved by a job that scans the tables where all those columns are empty and deletes them.
A local column can lead to confusion as its not immediately clear eg in community_actions whether it refers to the community or the person. Better to name it person_local, then we can also add community_local later if needed.