Re: BUG #17969: Assert failed in bloom_init() when false_positive_rate = 0.25

Alexander Law <exclusion@gmail.com>

From: Alexander Lakhin <exclusion@gmail.com>
To: shihao zhong <zhong950419@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Tomas Vondra <tomas.vondra@enterprisedb.com>, pgsql-bugs@lists.postgresql.org, Masahiko Sawada <sawada.mshk@gmail.com>
Date: 2023-10-24T13:00:00Z
Lists: pgsql-bugs
Hi Shihao,

23.10.2023 23:58, shihao zhong wrote:
> Hi Alexander,
>
> This change makes sense to me. But I have a question here, because we already have a limitation in rel option level 
> and that will make sure the parameter is in 0.0001 - 0.25 range, this CHECK seems like a little redundant for me 
> especially it does not match the constraint in rel option. Maybe I missed some context here, but could we just remove 
> this CHECK?

I had started this discussion with the same question, but Tom Lane proposed
to reformulate the Assert [1] and I agree that it's for good.
Index attribute options are checked when an index created, but then
attoptions can be changed in pg_attribute, for example. I mean that such
a check makes sense because there is an intermediate level between setting
the option and using it.

[1] https://www.postgresql.org/message-id/836412.1686502986%40sss.pgh.pa.us

Best regards,
Alexander



Commits

  1. Enlarge assertion in bloom_init() for false_positive_rate