Re: Stampede of the JIT compilers

2023-06-26 Thread Andres Freund
Hi, On 2023-06-24 13:54:53 -0400, Tom Lane wrote: > I think there is *plenty* of evidence that it is too low, or at least > that for some reason we are too willing to invoke JIT when the result > is to make the overall cost of a query far higher than it is without. > Just see all the complaints on

Re: Stampede of the JIT compilers

2023-06-26 Thread Laurenz Albe
On Sun, 2023-06-25 at 11:10 +0200, Michael Banck wrote: > On Sat, Jun 24, 2023 at 01:54:53PM -0400, Tom Lane wrote: > > I don't know whether raising the default would be enough to fix that > > in a nice way, and I certainly don't pretend to have a specific value > > to offer.  But it's undeniable t

Re: Stampede of the JIT compilers

2023-06-25 Thread James Coleman
On Sun, Jun 25, 2023 at 5:10 AM Michael Banck wrote: > > Hi, > > On Sat, Jun 24, 2023 at 01:54:53PM -0400, Tom Lane wrote: > > I don't know whether raising the default would be enough to fix that > > in a nice way, and I certainly don't pretend to have a specific value > > to offer. But it's unde

Re: Stampede of the JIT compilers

2023-06-25 Thread Michael Banck
Hi, On Sat, Jun 24, 2023 at 01:54:53PM -0400, Tom Lane wrote: > I don't know whether raising the default would be enough to fix that > in a nice way, and I certainly don't pretend to have a specific value > to offer. But it's undeniable that we have a serious problem here, > to the point where JI

Re: Stampede of the JIT compilers

2023-06-24 Thread James Coleman
On Sat, Jun 24, 2023 at 8:14 PM David Rowley wrote: > > On Sun, 25 Jun 2023 at 05:54, Tom Lane wrote: > > > > James Coleman writes: > > > On Sat, Jun 24, 2023 at 7:40 AM Tomas Vondra > > > wrote: > > >> On 6/24/23 02:33, David Rowley wrote: > > >>> On Sat, 24 Jun 2023 at 02:28, James Coleman w

Re: Stampede of the JIT compilers

2023-06-24 Thread James Coleman
On Sat, Jun 24, 2023 at 1:54 PM Tom Lane wrote: > > James Coleman writes: > > In that context capping the number of backends compiling, particularly > > where plans (and JIT?) might be cached, could well save us (depending > > on workload). > > TBH I do not find this proposal attractive in the le

Re: Stampede of the JIT compilers

2023-06-24 Thread David Rowley
On Sun, 25 Jun 2023 at 05:54, Tom Lane wrote: > > James Coleman writes: > > On Sat, Jun 24, 2023 at 7:40 AM Tomas Vondra > > wrote: > >> On 6/24/23 02:33, David Rowley wrote: > >>> On Sat, 24 Jun 2023 at 02:28, James Coleman wrote: > There are a couple of issues here. I'm sure it's been di

Re: Stampede of the JIT compilers

2023-06-24 Thread Tom Lane
James Coleman writes: > On Sat, Jun 24, 2023 at 7:40 AM Tomas Vondra > wrote: >> On 6/24/23 02:33, David Rowley wrote: >>> On Sat, 24 Jun 2023 at 02:28, James Coleman wrote: There are a couple of issues here. I'm sure it's been discussed before, and it's not the point of my thread, but

Re: Stampede of the JIT compilers

2023-06-24 Thread James Coleman
On Sat, Jun 24, 2023 at 7:40 AM Tomas Vondra wrote: > > > > On 6/24/23 02:33, David Rowley wrote: > > On Sat, 24 Jun 2023 at 02:28, James Coleman wrote: > >> There are a couple of issues here. I'm sure it's been discussed > >> before, and it's not the point of my thread, but I can't help but note

Re: Stampede of the JIT compilers

2023-06-24 Thread Tomas Vondra
On 6/24/23 02:33, David Rowley wrote: > On Sat, 24 Jun 2023 at 02:28, James Coleman wrote: >> There are a couple of issues here. I'm sure it's been discussed >> before, and it's not the point of my thread, but I can't help but note >> that the default value of jit_above_cost of 10 seems abs

Re: Stampede of the JIT compilers

2023-06-23 Thread David Rowley
On Sat, 24 Jun 2023 at 02:28, James Coleman wrote: > There are a couple of issues here. I'm sure it's been discussed > before, and it's not the point of my thread, but I can't help but note > that the default value of jit_above_cost of 10 seems absurdly low. > On good hardware like we have eve

Stampede of the JIT compilers

2023-06-23 Thread James Coleman
Hello, We recently brought online a new database cluster, and in the course of ramping up traffic to it encountered a situation where a misplanned query (analyzing helped with this, but I think the issue is still relevant) resulted in that query being compiled with JIT, and soon a large number of