Re: Automatically setting work_mem
От
Csaba Nagy
Тема
Re: Automatically setting work_mem
Дата
Msg-id
1142608064.16487.34.camel@coppola.muc.ecircle.de
Ответ на
Re: Automatically setting work_mem (Tom Lane)
Список
Дерево обсуждения
Re: Automatically setting work_mem "Qingqing Zhou" <zhouqq@cs.toronto.edu>
Re: Automatically setting work_mem Simon Riggs <simon@2ndquadrant.com>
Re: Automatically setting work_mem Tom Lane <tgl@sss.pgh.pa.us>
Re: Automatically setting work_mem Csaba Nagy <nagy@ecircle-ag.com>
Re: Automatically setting work_mem "Luke Lonergan" <llonergan@greenplum.com>
Re: Automatically setting work_mem Tom Lane <tgl@sss.pgh.pa.us>
Re: Automatically setting work_mem "Luke Lonergan" <llonergan@greenplum.com>
Re: Automatically setting work_mem Simon Riggs <simon@2ndquadrant.com>
Re: Automatically setting work_mem Thomas Hallgren <thomas@tada.se>
Re: Automatically setting work_mem Andreas Pflug <pgadmin@pse-consulting.de>
Re: Automatically setting work_mem Hannu Krosing <hannu@skype.net>
Re: Automatically setting work_mem Tom Lane <tgl@sss.pgh.pa.us>
Re: Automatically setting work_mem Martijn van Oosterhout <kleptog@svana.org>
Re: Automatically setting work_mem Simon Riggs <simon@2ndquadrant.com>
Re: Automatically setting work_mem Martijn van Oosterhout <kleptog@svana.org>
Re: Automatically setting work_mem Tom Lane <tgl@sss.pgh.pa.us>
Re: Automatically setting work_mem Simon Riggs <simon@2ndquadrant.com>
Re: [PATCHES] Automatically setting work_mem Simon Riggs <simon@2ndquadrant.com>
Re: [PATCHES] Automatically setting work_mem Simon Riggs <simon@2ndquadrant.com>
Re: [PATCHES] Automatically setting work_mem "Jim C. Nasby" <jnasby@pervasive.com>
Re: [PATCHES] Automatically setting work_mem Bruce Momjian <pgman@candle.pha.pa.us>
Re: [PATCHES] Automatically setting work_mem Simon Riggs <simon@2ndquadrant.com>
Re: [PATCHES] Automatically setting work_mem Tom Lane <tgl@sss.pgh.pa.us>
Re: [PATCHES] Automatically setting work_mem Simon Riggs <simon@2ndquadrant.com>
Re: [PATCHES] Automatically setting work_mem daveg <daveg@sonic.net>
Re: [PATCHES] Automatically setting work_mem David Fetter <david@fetter.org>
Re: [PATCHES] Automatically setting work_mem daveg <daveg@sonic.net>
Re: Automatically setting work_mem Bruno Wolff III <bruno@wolff.to>
Re: [PATCHES] Automatically setting work_mem "Jim C. Nasby" <jnasby@pervasive.com>
Re: Automatically setting work_mem "Luke Lonergan" <llonergan@greenplum.com>
Re: Automatically setting work_mem Tom Lane <tgl@sss.pgh.pa.us>
Re: Automatically setting work_mem "Luke Lonergan" <llonergan@greenplum.com>
Re: Automatically setting work_mem Josh Berkus <josh@agliodbs.com>
Re: Automatically setting work_mem Tom Lane <tgl@sss.pgh.pa.us>
Re: Automatically setting work_mem "Luke Lonergan" <llonergan@greenplum.com>
> My own thoughts about the problems with our work_mem arrangement are > that the real problem is the rule that we can allocate work_mem per sort > or hash operation; this makes the actual total memory use per backend > pretty unpredictable for nontrivial queries. I don't know how to fix > this though. The planner needs to know the work_mem that will be used > for any one of these operations in order to estimate costs, so simply > trying to divide up work_mem among the operations of a completed plan > tree is not going to improve matters. I know this is not "right to the point" related to what is discussed in this thread, and that it would need some serious work, but how about a mechanism to allow plans some flexibility at run-time ? What I mean is not to do all the decisions at plan time, but include some "branches" in the plan, and execute one branch or the other depending on actual parameter values, current statistics, current memory available, ... (name here other run-time resources). This would make a lot more feasible to long-term cache query plans. For e.g. you wouldn't have to worry too much about changing statistics if at runtime you can check them again... and you could put decision points based on current memory resources. Of course it still must be a balance between the number of the decision points (which ultimately means the size of the plan) and robustness against changing conditions, i.e. branches should only go in for conditions likely to change. Is this completely not feasible with current postgres architecture ? I have no idea how the planning/runtime works internally. It worths a look at how apache Derby does with query planning, where a planned query is actually a compiled Java class, i.e. the executable byte code which will run to fetch the results, created and compiled by the planner... interesting approach, allows for lots of flexibility at run-time, but probably won't work with C :-) Cheers, Csaba.
В списке pgsql-hackers по дате отправления