Re: 14.1 immutable function, bad performance if check number = 'NaN' - Mailing list pgsql-bugs

From Tom Lane
Subject Re: 14.1 immutable function, bad performance if check number = 'NaN'
Date
Msg-id 116336.1650913412@sss.pgh.pa.us
Whole thread Raw
In response to 14.1 immutable function, bad performance if check number = 'NaN'  (Federico Travaglini <federico.travaglini@aubay.it>)
Responses Re: 14.1 immutable function, bad performance if check number = 'NaN'
List pgsql-bugs
Federico Travaglini <federico.travaglini@aubay.it> writes:
> This funcion in used as a column in a select on about 400k records
> If I leave the highlighted row it takes 27 seconds, otherwise 14 seconds!
> Such behaviour looks not to be reasonable.

It's not at all clear which line you think is the "highlighted" one.

However, I'm guessing that this SQL function is a candidate for
inlining, so you might try comparing EXPLAIN VERBOSE output for
the query with both forms of the function.  Perhaps that will
yield some insight into what's expensive.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Is this a known Bug?
Next
From: "David G. Johnston"
Date:
Subject: Re: 14.1 immutable function, bad performance if check number = 'NaN'