Re: query planning different in plpgsql?
От
Michal J. Kubski
Тема
Re: query planning different in plpgsql?
Дата
Msg-id
3d1f13b434eef584e404153f43511c65@localhost
Ответ на
Re: query planning different in plpgsql? (Tom Lane)
Список
Дерево обсуждения
query planning different in plpgsql? Michal J. Kubski <michal.kubski@cdt.pl>
Re: query planning different in plpgsql? Scott Carey <scott@richrelevance.com>
Re: query planning different in plpgsql? Scott Mead <scott.lists@enterprisedb.com>
Re: query planning different in plpgsql? Tom Lane <tgl@sss.pgh.pa.us>
Re: query planning different in plpgsql? Grzegorz Jaśkiewicz <gryzman@gmail.com>
Re: query planning different in plpgsql? Michal J. Kubski <michal.kubski@cdt.pl>
Re: query planning different in plpgsql? Merlin Moncure <mmoncure@gmail.com>
Re: query planning different in plpgsql? Michal J. Kubski <michal.kubski@cdt.pl>
Re: query planning different in plpgsql? Tom Lane <tgl@sss.pgh.pa.us>
Re: query planning different in plpgsql? "Michal J. Kubski" <michal.kubski@cdt.pl>
Re: query planning different in plpgsql? Waldomiro <waldomiro@shx.com.br>
On Mon, 26 Oct 2009 14:09:49 -0400, Tom Lane wrote: > "Michal J. Kubski" writes: >> [ function that creates a bunch of temporary tables and immediately >> joins them ] > > It'd probably be a good idea to insert an ANALYZE on the temp tables > after you fill them. The way you've got this set up, there is no chance > of auto-analyze correcting that oversight for you, so the planner will > be planning the join "blind" without any stats. Good results would only > come by pure luck. > > regards, tom lane Hi, Apologies for late response. Thanks a lot: ANALYZE seem to help it! I still sometimes get long query runs though. As far as I understand using index over sequential scan on joins should be faster. Could it be possible that the query planner decides to use seqscan instead of index scan on some random occasions? Thanks, Michal -- I hear and I forget. I see and I believe. I do and I understand. (Confucius)
В списке pgsql-performance по дате отправления