Re: Bug in row_number() optimization

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sergey Shinderuk <s(dot)shinderuk(at)postgrespro(dot)ru>
Cc: Richard Guo <guofenglinux(at)gmail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, David Rowley <drowley(at)postgresql(dot)org>
Subject: Re: Bug in row_number() optimization
Date: 2022-11-25 16:19:09
Message-ID: 4059995.1669393149@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sergey Shinderuk <s(dot)shinderuk(at)postgrespro(dot)ru> writes:
> What about user-defined operators? I created my own <= operator for int8
> which returns true on null input, and put it in a btree operator class.
> Admittedly, it's weird that (null <= 1) evaluates to true. But does it
> violate the contract of the btree operator class or something? Didn't
> find a clear answer in the docs.

It's pretty unlikely that this would work during an actual index scan.
I'm fairly sure that btree (and other index AMs) have hard-wired
assumptions that index operators are strict.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ted Yu 2022-11-25 16:22:58 Re: checking rd_rules in RelationBuildDesc
Previous Message Tom Lane 2022-11-25 16:17:10 Re: checking rd_rules in RelationBuildDesc