Re: missing estimation for coalesce function
От | Laurenz Albe |
---|---|
Тема | Re: missing estimation for coalesce function |
Дата | |
Msg-id | 3524f9466c1a03e35bc0a78d9f72eaba572c0462.camel@cybertec.at обсуждение исходный текст |
Ответ на | missing estimation for coalesce function (Pavel Stehule <pavel.stehule@gmail.com>) |
Ответы |
Re: missing estimation for coalesce function
|
Список | pgsql-hackers |
On Wed, 2019-11-27 at 08:47 +0100, Pavel Stehule wrote: > The most significant issue was missing correct estimation for coalesce function. > He had to rewrite coalesce(var, X) = X to "var IS NULL or var = X". > Then the result was very satisfactory. > > postgres=# explain analyze select * from xxx where coalesce(a, 0) = 0; > QUERY PLAN > ---------------------------------------------------------------------------------------------------- > Seq Scan on xxx (cost=0.00..194.00 rows=60 width=4) (actual time=0.041..4.276 rows=11000 loops=1) I think that this is asking for a planner support function: https://www.postgresql.org/docs/current/xfunc-optimization.html Yours, Laurenz Albe
В списке pgsql-hackers по дате отправления: