Re: Plan for update ... where a is not distinct from b

2017-11-28 Thread Peter J. Holzer
On 2017-11-28 20:48:24 +0100, Laurenz Albe wrote: > Peter J. Holzer wrote: > > I noticed that an update was taking a long time and found this: > > > > UPDATE public.facttable_imf_ifs p > > SET [...lots of columns...] > > FROM cleansing.cls_imf_ifs_facttable_imf_ifs c, > > cleansing.cleansing_chan

Re: Plan for update ... where a is not distinct from b

2017-11-28 Thread Peter J. Holzer
On 2017-11-28 09:35:33 -0500, Tom Lane wrote: > "Peter J. Holzer" writes: > > I noticed that an update was taking a long time and found this: > > [ crappy plan for join on IS NOT DISTINCT ] > > Yeah, there's no optimization smarts at all for IS [NOT] DISTINCT. > It can't be converted into a merge

Re: Plan for update ... where a is not distinct from b

2017-11-28 Thread Laurenz Albe
Peter J. Holzer wrote: > I noticed that an update was taking a long time and found this: > > UPDATE public.facttable_imf_ifs p > SET [...lots of columns...] > FROM cleansing.cls_imf_ifs_facttable_imf_ifs c, > cleansing.cleansing_change_type ct > WHERE > (p.macrobondtimeseries is not distinct

Re: Plan for update ... where a is not distinct from b

2017-11-28 Thread Tom Lane
"Peter J. Holzer" writes: > I noticed that an update was taking a long time and found this: > [ crappy plan for join on IS NOT DISTINCT ] Yeah, there's no optimization smarts at all for IS [NOT] DISTINCT. It can't be converted into a merge qual, nor a hash qual, nor an indexscan qual. In princip

Plan for update ... where a is not distinct from b

2017-11-28 Thread Peter J. Holzer
[PostgreSQL 9.5.10 on x86_64-pc-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit] I noticed that an update was taking a long time and found this: UPDATE public.facttable_imf_ifs p SET [...lots of columns...] FROM cleansing.cls_imf_ifs_facttable_imf_ifs c, cleansing.cleansing_change_type