Re: Slow planning time when public schema included (12 vs. 9.4)

2020-03-21 Thread Tom Lane
Anders Steinlein writes: > On Sat, Mar 21, 2020 at 8:35 PM Tom Lane wrote: >> It seems odd to me too. I'm not at all surprised that citext comparison >> is way slower than text, but I am surprised that you don't see that on 9.4 >> as well. > Indeed. But also, how come this is part of the

Re: Slow planning time when public schema included (12 vs. 9.4)

2020-03-21 Thread Anders Steinlein
On Sat, Mar 21, 2020 at 8:35 PM Tom Lane wrote: > Anders Steinlein writes: > > So I don't understand this big difference? Because it does seem like > citext > > is indeed the difference. > > It seems odd to me too. I'm not at all surprised that citext comparison > is way slower than text, but

Re: Slow planning time when public schema included (12 vs. 9.4)

2020-03-21 Thread Tom Lane
Anders Steinlein writes: > On Sat, Mar 21, 2020 at 3:26 PM Tom Lane wrote: >> Not sure why you'd not have seen the same effect in your 9.4 >> installation, but maybe you had citext installed somewhere else? > The tables segments and contacts_lists are identical on the two instances, > i.e. both

Re: Slow planning time when public schema included (12 vs. 9.4)

2020-03-21 Thread Anders Steinlein
On Sat, Mar 21, 2020 at 3:26 PM Tom Lane wrote: > Anders Steinlein writes: > > We haven't noticed any issues with this before now, until we started > seeing > > really slow planning time on some relatively simple queries: > > ... > > The planning time is the same even if running the same query

Re: Slow planning time when public schema included (12 vs. 9.4)

2020-03-21 Thread Anders Steinlein
On Sat, Mar 21, 2020 at 2:37 PM Andreas Kretschmer wrote: > > > Am 21.03.20 um 13:02 schrieb Anders Steinlein: > > default_statistics_target = 1000 > > not sure if this be the culprit here, but i think this is way too high. > Leave it at the normal value of 100 and raise it only for particular >

Re: Slow planning time when public schema included (12 vs. 9.4)

2020-03-21 Thread Tom Lane
Anders Steinlein writes: > We haven't noticed any issues with this before now, until we started seeing > really slow planning time on some relatively simple queries: > ... > The planning time is the same even if running the same query multiple times > within the same session. When having only the

Re: Slow planning time when public schema included (12 vs. 9.4)

2020-03-21 Thread Andreas Kretschmer
Am 21.03.20 um 13:02 schrieb Anders Steinlein: default_statistics_target = 1000 not sure if this be the culprit here, but i think this is way too high. Leave it at the normal value of 100 and raise it only for particular tables and columns. Regards, Andreas -- 2ndQuadrant - The

Slow planning time when public schema included (12 vs. 9.4)

2020-03-21 Thread Anders Steinlein
Hi, We have a multi-tenant app where each tenant has their own schemas, and inherits tables from tables defined in the public schema. Other shared data such as data types are also stored in the public schema. While running this app, every transaction is started with setting the search_path to ,