Re: 14.1 immutable function, bad performance if check number = 'NaN'

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Federico Travaglini <federico(dot)travaglini(at)aubay(dot)it>
Cc: pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: 14.1 immutable function, bad performance if check number = 'NaN'
Date: 2022-04-25 19:24:25
Message-ID: CAHyXU0ye7LvS0W+MOvV40TVMaw5fF0OrogF2TGq4jHBHvVo+LA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Apr 25, 2022 at 11:58 AM Federico Travaglini <
federico(dot)travaglini(at)aubay(dot)it> wrote:

> Good evening, and thanks to your excellent Postgres.
>
>
>
> 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.
>
>
lightly testing this, I got 10million iterations in about two seconds,
about the same after commenting the NaN test. Given that, problem is
probably failure to inline query. Careful examination of explain of
wrapping query should prove that.

merlin

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2022-04-25 20:18:16 BUG #17468: Ranking of search results: ts_rank_cd with normalization variant 4
Previous Message David G. Johnston 2022-04-25 19:06:25 Re: 14.1 immutable function, bad performance if check number = 'NaN'