Re: An Idea for planner hints
От | Tom Lane |
---|---|
Тема | Re: An Idea for planner hints |
Дата | |
Msg-id | 12742.1155068085@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: An Idea for planner hints (Martijn van Oosterhout <kleptog@svana.org>) |
Ответы |
Re: An Idea for planner hints
Re: An Idea for planner hints Re: An Idea for planner hints Re: An Idea for planner hints |
Список | pgsql-hackers |
Martijn van Oosterhout <kleptog@svana.org> writes: > ISTM theat the easiest way would be to introduce a sort of predicate > like so: > SELECT * FROM foo, bar WHERE pg_selectivity(foo.a = bar.a, 0.1); The one saving grace of Florian's proposal was that you could go hack the statistics *without* changing your queries. This throws that away again. The thing I object to about the "I want to decorate my queries with planner hints" mindset is that it's coming at it from the wrong direction. You should never be thinking in terms of "fix this one query", because that just leads back into the same dead end that your fix doesn't work tomorrow. What you *should* be thinking about is "why did the planner get this wrong, and how do I fix the generic problem?". If you attack it that way then your fix is much more likely to work on the next slightly-different query. So some kind of override for statistical guesses doesn't seem completely silly to me. But it needs to be declarative information that's stored somewhere out of view of the actual SQL queries. IMHO anyway. regards, tom lane
В списке pgsql-hackers по дате отправления: