Anthony Presley <anthony@resolution.com> writes:
> I have tried setting the statistics on employee.user_id to be 100 and 1000,
> and the rest are the default (100).
> I've run both an "ANALYZE" and a "VACUUM ANALYZE" on the production system -
> both "generally", and on each of the above tables (employee, app_user,
> location, preference).
> Here's an updated explain of the most recent attempt. About 5 minutes after
> I analyzed them:
> http://explain.depesz.com/s/G32
Looks like the biggest estimation errors are on the location_id joins.
Maybe you should be cranking up the stats targets on those columns.
regards, tom lane