Re: Query optimization help
От | Ondrej Ivanič |
---|---|
Тема | Re: Query optimization help |
Дата | |
Msg-id | CAM6mieJaFU8+g35TLNRmd+kOieoY7Gk06x1MvnyaTy0EOvJxEQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Query optimization help (Szymon Kosok <szymon@mwg.pl>) |
Ответы |
Re: Query optimization help
|
Список | pgsql-performance |
Hi, On 30 August 2011 15:36, Szymon Kosok <szymon@mwg.pl> wrote: > Hello, > > I asked that question on StackOverflow, but didn't get any valuable > response, so I'll ask it here. :) > > I have such query: Could you please re-post your explain using this web site: http://explain.depesz.com/ and post links to Stackoverflow question? What is your Postgres version? Database settings? I see huge discrepancy between predicted and actual row numbers (like 1264420 vs 485). I would try the following: - check column statistics (pg_stasts) and focus on the following columns: n_distinct, null_frac, most_common_vals. If they are way-off from the actual values then you should tweak (auto)analyze process: run manual/auto analyse more often (check pg_stat_user_tables), increase default_statistics_target (per column or global) - try to disable nested loop join (set enable_nestloop=off) -- Ondrej Ivanic (ondrej.ivanic@gmail.com)
В списке pgsql-performance по дате отправления: