Closed rodricios closed 2 years ago
ActiveHash::Relation
is where this code lives:
When the query is being resolved, the set of records is iterated over once, and records matching the query are selected -- so this is an O(n)
linear-time search.
Does that explanation make sense?
@flavorjones, thank you!
Say we have a simple yaml file like so:
And we perform a query on the "Person" ActiveHash model that wraps that yaml file like so:
Are we doing linear searches to find the correct entry or is there an internal index/hash map built on the fields (like
name
) of each entry that we query against?