Re: Query performance help with 'shadow table' approach.
| От | Ondrej Ivanič |
|---|---|
| Тема | Re: Query performance help with 'shadow table' approach. |
| Дата | |
| Msg-id | CAM6mie+ViQYOSAybbe-G9MmB51BDNj8i=E=Cka9B3pqv4vndEA@mail.gmail.com обсуждение исходный текст |
| Ответ на | Query performance help with 'shadow table' approach. (Brian Fehrle <brianf@consistentstate.com>) |
| Список | pgsql-general |
Hi, On 14 September 2011 07:44, Brian Fehrle <brianf@consistentstate.com> wrote: > 2. I have appropriate indexes where they need to be. The issue is in the > query planner not using them due to it (i assume) just being faster to scan > the whole table when the data set it needs is as large as it is. Try to reduce random_page cost to 2, which biased planner towards index scans, (set random_page = 2 before the query; assuming that default seq_page_cost and random_page_cost are 1 and 4 respectively) and run "explain analyze". Sometimes is worth to disable nested loops join (set enable_nestloop = off). Finally you can increase default_statistics_target (or ALTER TABLE SET STATISTICS) to 100 (8.4 has this as a default) on selected columns or table (and run analyze on that table). -- Ondrej Ivanic (ondrej.ivanic@gmail.com)
В списке pgsql-general по дате отправления: