Join cardinality estimate is off, help wanted.
I have a query with several inner joins of views which themselves include inner joins. The query works, but the execution plans selected are often suboptimal. This happens because the optimizer estimates the join cardinality wrongly. Typically the estimates suggest 50000 rows where in actuality there will be 5 million rows. The join conditions are on the primary/foreign-keys which consist of 2 columns each. The statistics on the tables are fresh and fine, which can be seen in the accurate estimates on how many rows will be delivered from each table. I have defines a stats-extension on the combination of