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
In response to
pgsql-novice by date
|Next:||From: Richard Brooksby||Date: 2004-03-15 20:53:36|
|Subject: Re: Text pattern JOINs that use indexes |
|Previous:||From: Richard Brooksby||Date: 2004-03-15 18:48:25|
|Subject: Text pattern JOINs that use indexes|