agora inbox for pgsql-bugs@postgresql.org
help / color / mirror / Atom feedFrom: Tom Lane <tgl@sss.pgh.pa.us>
To: Federico Travaglini <federico.travaglini@aubay.it>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: 14.1 immutable function, bad performance if check number = 'NaN'
Date: Mon, 25 Apr 2022 15:03:32 -0400
Message-ID: <116336.1650913412@sss.pgh.pa.us> (raw)
In-Reply-To: <a883c3fd5675d6a514d310388f4098de@mail.gmail.com>
References: <a883c3fd5675d6a514d310388f4098de@mail.gmail.com>
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
view thread (5+ messages) latest in thread
Message-ID: <116336.1650913412@sss.pgh.pa.us>
Permalink: ../116336.1650913412@sss.pgh.pa.us/
Also on: postgresql.org/message-id/116336.1650913412@sss.pgh.pa.us
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, federico.travaglini@aubay.it, pgsql-bugs@lists.postgresql.org
Subject: Re: 14.1 immutable function, bad performance if check number = 'NaN'
In-Reply-To: <116336.1650913412@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox