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

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Robert James <srobertjames(at)gmail(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: What type of index do I need for this JOIN?
Date: 2013-08-14 13:14:41
Message-ID: 1376486081.24824.YahooMailNeo@web162903.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2013-08-14 13:25:55 Re: Please help
Previous Message Kevin Grittner 2013-08-14 13:10:48 Re: Materializing a view by hand