mark.lubratt@indeq.com writes:
> I'm trying to optimize a query and the EXPLAIN ANALYZE (see link below)
> shows that some hash join row estimates are wrong by a factor of 2-3,
> and upwards of 7-8.
I doubt that improving those estimates would lead to markedly better
results. You need to think about improving the view design instead.
What context is this view used in --- do you just do "select * from
view_get_all_user_award2", or are there conditions added to it, or
perhaps it gets joined with other things? Do you really need the
DISTINCT constraint? Do you really need the ORDER BY? Can you
simplify the WHERE clause at all?
Half a second sounds pretty decent to me for a ten-way join with a WHERE
clause as unstructured as that. If you really need it to execute in way
less time, you're probably going to have to rethink your data
representation to make the query simpler.
regards, tom lane