Re: Correcting Hash Join Estimates

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Correcting Hash Join Estimates
Дата
Msg-id 17973.1112594057@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Correcting Hash Join Estimates  (mark.lubratt@indeq.com)
Ответы Re: Correcting Hash Join Estimates  (Mark Lubratt <mark.lubratt@indeq.com>)
Список pgsql-performance
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

В списке pgsql-performance по дате отправления:

Предыдущее
От: mark.lubratt@indeq.com
Дата:
Сообщение: Correcting Hash Join Estimates
Следующее
От: Mark Lubratt
Дата:
Сообщение: Re: Correcting Hash Join Estimates