Re: What type of index do I need for this JOIN?

From: Robert James <srobertjames(at)gmail(dot)com>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>
Cc: Craig Ringer <craig(at)2ndquadrant(dot)com>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: What type of index do I need for this JOIN?
Date: 2013-08-15 00:15:43
Message-ID: CAGYyBgi=nkTWLca+bvXsgv6_ffCD=L+FXJ0JtCZS_V+X04TawQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/14/13, Kevin Grittner <kgrittn(at)ymail(dot)com> wrote:
> Robert James <srobertjames(at)gmail(dot)com> wrote:
>
>> I'm confused: What's the difference between
>> col LIKE 'foo%'
>> and
>> col LIKE f1 || '%'
>> ?
>
> The planner knows that 'foo%' doesn't start with a wildcard.
>
>> Either way, it's anchored to the beginning of the string.
>
> Not necessarily.

I see, yes, f1 might include a wildcard.

Is there a way to escape f1 so that wildcards aren't interpreted?
That's anyway the behavior I need, of course. And will that help the
planner?

What type of index will help the planner here?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jayadevan M 2013-08-15 02:14:20 Re: Debugging Postgres?
Previous Message Bruce Momjian 2013-08-14 21:00:34 Re: Getting list of supported types in Postgres