Forum OpenACS Q&A: Response to outer joins, views, and indexes in PG

Collapse
Posted by Jonathan Ellis on
that didn't work either; something about it is convincing the optimizer it needs to scan all 13k rows of the weapons table.

I created a materialized view of weapons and weapon_types and that fixed this particular problem but when I start join this view (minion_weapons_denorm_v, that is) with others the same thing starts happening.  Apparently something in the nature of these joins is confusing hell out of the planner and it's joining the entire minions and weapons table together before applying the minion_id constraint that cuts it down to one row.  (!)