I understand the issue is the amp-parsed-stylesheet
transients?
When the AMP plugin encounters a stylesheet it hasn’t encountered before, it parses the stylesheet and stores the parsed representation in a transient. This is to avoid having to parse it again, as the parsing is computationally intensive. The stylesheet needs to be parsed in order to validate it and also in order to perform tree shaking so that the AMP plugin can remove unused CSS to bring the total under the 75KB limit.
So the fact that there are amp-parsed-stylesheet
transients is normal. What is not normal is that there are so many. Can you do a count for the number of such rows? For example:
SELECT COUNT(*) FROM wp_options WHERE option_name LIKE '_transient_amp-parsed-stylesheet%'
You can also determine the amount of storage used by these rows for example:
SELECT SUM(LENGTH(option_value)) FROM wp_options WHERE option_name LIKE '_transient_amp-parsed-stylesheet%';
Apparently this should be something large like 1000000000.
One possible cause is for stylesheets being highly variable. If a stylesheet changes at all, then that causes a new transient to be added. We did a bunch of work to try to catch this situation and turn off caching parsed stylesheets in that case, to prevent filling up the DB. See https://github.com/ampproject/amp-wp/issues/2092
If you go into your Site Health, is there any AMP test being reported for transient caching of parsed stylesheets being disabled?