Richard Brooksby <rb(at)ravenbrook(dot)com> writes:
> explain select * from files where name like 'foo%';
This is indexable because the LIKE pattern is a constant at plan time,
and so the planner can see that there's a useful range constraint
extractable from the pattern.
> explain select * from test join files on files.name like test.filename
> || '%';
This is not indexable, because the LIKE pattern is not constant.
regards, tom lane