Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4dccf95

Browse files
committed
Enlarge assertion in bloom_init() for false_positive_rate
false_positive_rate is a parameter that can be set with the bloomopclass in BRIN, and setting it to a value of exactly 0.25 would triggeran assertion in the first INSERT done on the index with value set.The assertion changed here relied on BLOOM_{MIN|MAX}_FALSE_POSITIVE_RATEthat are somewhat arbitrary values, and specifying an out-of-range valuewould also trigger a failure when defining such an index. So, as-is,the assertion was just doubling on the min-max check of the reloption.This is now enlarged to check that it is a correct percentage value,instead, based on a suggestion by Tom Lane.Author: Alexander LakhinReviewed-by: Tom Lane, Shihao ZhongDiscussion:https://postgr.es/m/17969-a6c54de48026d694@postgresql.orgBackpatch-through: 14
1 parent3edc658 commit4dccf95

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎src/backend/access/brin/brin_bloom.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,7 @@ bloom_init(int ndistinct, double false_positive_rate)
279279
doublek;/* number of hash functions */
280280

281281
Assert(ndistinct>0);
282-
Assert((false_positive_rate >=BLOOM_MIN_FALSE_POSITIVE_RATE)&&
283-
(false_positive_rate<BLOOM_MAX_FALSE_POSITIVE_RATE));
282+
Assert(false_positive_rate>0&&false_positive_rate<1);
284283

285284
/* sizing bloom filter: -(n * ln(p)) / (ln(2))^2 */
286285
nbits=ceil(-(ndistinct*log(false_positive_rate)) /pow(log(2.0),2));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp