Electric.Shapes.Filter.Indexes.EqualityIndex (electric v1.4.13)

View Source

Efficiently finds shapes that are affected by a change when the shape's where clause has field = const in it.

Data is stored in the Filter's eq_index_table ETS table with keys of the form: {condition_id, field, value} -> {type, next_condition_id}

The type is stored to know how to parse values from records. The next_condition_id points to a WhereCondition for the remaining conditions of the where clause.

Additionally, the field type is cached at: {:type, condition_id, field} -> type This enables O(1) type lookup for parsing record values.

Summary

Functions

add_shape(filter, condition_id, shape_id, optimisation)

affected_shapes(filter, condition_id, field, record)

all_shape_ids(filter, condition_id, field)

remove_shape(filter, condition_id, shape_id, optimisation)