> LIKE doesn't know anything about indexes, nor vice versa. What the
> index-scan machinery *does* know about is <, <=, etc. If you have
> WHERE clauses like "x >= 33" and "x <= 54" then an index scan knows
> to only scan the part of the index from 33 to 54. So you never even
> visit a large fraction of the table. This is why an index scan can
> be faster than a sequential scan even though the per-tuple overhead
> of consulting the index is larger.
>
You know, everyone beats me up for that LIKE indexing hack, but every
month that goes by where someone does not come up with a better solution
makes me feel a little better about the criticism.
-- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026