Re: like performance w/o wildcards. - Mailing list pgsql-general

From Joseph Shraibman
Subject Re: like performance w/o wildcards.
Date
Msg-id 3F2DD311.5020100@selectacast.net
Whole thread Raw
In response to Re: like performance w/o wildcards.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: like performance w/o wildcards.  (Richard Huxton <dev@archonet.com>)
List pgsql-general
Hmm.  I didn't work for me.  I'll try and figure this out.

Tom Lane wrote:
> Joseph Shraibman <jks@selectacast.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



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dumpall doesn't support -s anymore?
Next
From: Hervé Piedvache
Date:
Subject: Re: PostgreSQL consulting company in France or Europe?