Correct Internals Documentation
Correct Internals Documentation

Materialized paths are wild-carded from the right hand side according to the code.

https://github.com/stefankroes/ancestry/blob/master/lib/ancestry/materialized_path.rb#L35

Generally speaking b-tree indexes can only do right-hand side LIKE optimizations, I've listed the postgresql documentation below as an example:

https://www.postgresql.org/docs/9.2/static/indexes-types.html
stefankroes/ancestry,kbrock/ancestry