It isn’t the complexity that is the problem. It is the open-ended nature. It lacks any WHERE clause that specifies which posts to get. It just kicks off join after join without restricting what it is looking for. It relies on the “LIMIT 50” that Lemmy restricts post listings too. Which worked OK in March 2023 when Lemmy was over 4 years old and still had very tiny amounts of data in all these tables that it joins, but once even a modest amount of data got point in the open-ended nature of the WHERE clause kept making it slower and slower as more and more content.
It isn’t the complexity that is the problem. It is the open-ended nature. It lacks any WHERE clause that specifies which posts to get. It just kicks off join after join without restricting what it is looking for. It relies on the “LIMIT 50” that Lemmy restricts post listings too. Which worked OK in March 2023 when Lemmy was over 4 years old and still had very tiny amounts of data in all these tables that it joins, but once even a modest amount of data got point in the open-ended nature of the WHERE clause kept making it slower and slower as more and more content.