Re: [PERFORM] LIKE should use index when condition doesn't include

2004-03-30 Thread Tom Lane
Josh Berkus <[EMAIL PROTECTED]> writes: > ILIKE is not somehow aware that it is equivalent to lower(). Is it? Given the wild and wonderful behaviors of locales here and there, I wouldn't want to assume that such an equivalence holds. In particular I note that iclike() seems to be multibyte-aware

Re: [PERFORM] LIKE should use index when condition doesn't include

2004-03-30 Thread Palle Girgensohn
--On tisdag, mars 30, 2004 16.56.09 -0800 Josh Berkus <[EMAIL PROTECTED]> wrote: Palle, But what about ILIKE. It does not take advantage of indices built with lower(): Nope. If you want to use a functional index, you'll need to use the function when you call the query. ILIKE is not somehow a

Re: [PERFORM] LIKE should use index when condition doesn't include

2004-03-30 Thread Josh Berkus
Palle, > Too bad... that was my idea, that it would somehow be aware that it is > equivalent to lower() like. It really is, isn't it? I would have though > they where synonymous. If not, makes ILIKE kind of unusable, at least > unless you're pretty certain the field will never indexed. Yup.

Re: [PERFORM] LIKE should use index when condition doesn't include

2004-03-30 Thread Josh Berkus
Palle, > But what about ILIKE. It does not take advantage of indices built with > lower(): Nope. If you want to use a functional index, you'll need to use the function when you call the query. ILIKE is not somehow aware that it is equivalent to lower(). -- -Josh Berkus Aglio Database Sol

Re: [PERFORM] LIKE should use index when condition doesn't include

2004-03-30 Thread Palle Girgensohn
--On tisdag, mars 30, 2004 19.16.44 -0500 Tom Lane <[EMAIL PROTECTED]> wrote: Palle Girgensohn <[EMAIL PROTECTED]> writes: Shouldn't the optimizer use indices if the like condition does not have any wildcards? I can't get excited about this; if you are depending on LIKE to be fast then you sho

Re: [PERFORM] LIKE should use index when condition doesn't include wildcard

2004-03-30 Thread Tom Lane
Palle Girgensohn <[EMAIL PROTECTED]> writes: > Shouldn't the optimizer use indices if the like condition does not have any > wildcards? I can't get excited about this; if you are depending on LIKE to be fast then you should have locale-insensitive indexes in place to support it. Switching the tes