Re: like performance w/o wildcards.

From: Joseph Shraibman <jks(at)selectacast(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql general list <pgsql-general(at)postgresql(dot)org>
Subject: Re: like performance w/o wildcards.
Date: 2003-08-04 03:29:21
Message-ID: 3F2DD311.5020100@selectacast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hmm. I didn't work for me. I'll try and figure this out.

Tom Lane wrote:
> Joseph Shraibman <jks(at)selectacast(dot)net> writes:
>
>>I notice in 7.3.3 the planner can't tell when a LIKE has no wildcards
>>and is in reality an '='. Is this an easy change to make?
>
>
> On what do you base that conclusion?
>
> regression=# create table t1 (f1 text unique);
> NOTICE: CREATE TABLE / UNIQUE will create implicit index 't1_f1_key' for table 't1'
> CREATE TABLE
> regression=# explain select * from t1 where f1 like 'foo';
> QUERY PLAN
> ---------------------------------------------------------------------
> Index Scan using t1_f1_key on t1 (cost=0.00..4.82 rows=1 width=32)
> Index Cond: (f1 = 'foo'::text)
> Filter: (f1 ~~ 'foo'::text)
> (3 rows)
>
> regression=#
>
> regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Hervé Piedvache 2003-08-04 07:41:01 Re: PostgreSQL consulting company in France or Europe?
Previous Message Tom Lane 2003-08-04 02:09:27 Re: pg_dumpall doesn't support -s anymore?