| 227 | } |
| 228 | |
| 229 | void |
| 230 | ExecInitRuntimeFilterFinish(RuntimeFilterState *node, double inner_rows) |
| 231 | { |
| 232 | List *hashops; |
| 233 | ListCell *lc; |
| 234 | int i = 0; |
| 235 | |
| 236 | hashops = node->hjstate->hj_HashOperators; |
| 237 | |
| 238 | node->value_buf = (Datum *) palloc(hashops->length * sizeof(Datum)); |
| 239 | node->raw_value = (bool *) palloc(hashops->length * sizeof(bool)); |
| 240 | node->inner_estimated = (uint64) inner_rows; |
| 241 | |
| 242 | node->bf = bloom_create_aggresive((int64) inner_rows, work_mem, random()); |
| 243 | if (node->bf == NULL) |
| 244 | node->build_suspend = true; |
| 245 | /* we can't handle inner table which is bigger than this threshold */ |
| 246 | node->inner_threshold = bloom_total_bits(node->bf) / 1.6; |
| 247 | |
| 248 | /* init hash function related fields */ |
| 249 | foreach(lc, hashops) |
| 250 | { |
| 251 | Oid outer_typ; |
| 252 | Oid inner_typ; |
| 253 | bool outer_raw; |
| 254 | bool inner_raw; |
| 255 | |
| 256 | op_input_types(lfirst_oid(lc), &outer_typ, &inner_typ); |
| 257 | outer_raw = IsRawInt8CmpType(outer_typ); |
| 258 | inner_raw = IsRawInt8CmpType(inner_typ); |
| 259 | |
| 260 | /* can we directly compare the i-th value as int8? */ |
| 261 | node->raw_value[i++] = outer_raw && inner_raw; |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | void |
| 266 | ExecEndRuntimeFilter(RuntimeFilterState *node) |
no test coverage detected