Try a pg_hint_plan Rows hint to explore what would happen to the plan if you
fixed the bad join cardinality estimate:
/*+ rows(prm prc #2028) */
alternatively you could specify a HashJoin hint, but I think it's better to
fix the cardinality estimate and then let the optimizer decide what the best
plan is.
I agree with Justin that it looks like the version and
recommended_content_id columns are correlated and that's the likely root
cause of the problem, but you don't need to upgrade to fix this one query.
-----
Jim Finnerty, AWS, Amazon Aurora PostgreSQL
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-performance-f2050081.html