Skip site navigation (1) Skip section navigation (2)

Searching in a string with index

From: "Alexander B(dot)" <burbello3000(at)yahoo(dot)com(dot)br>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Searching in a string with index
Date: 2007-07-25 13:17:41
Message-ID: 46A74D75.7000407@yahoo.com.br (view raw or flat)
Thread:
Lists: pgsql-admin
Hi,
When I search some words into a varchar column and this column has an index.
Does Postgres use index??

The search is done this way:

create table tb_gen_person (
  pes_nro_doc numeric(14) not null,
  pes_name varchar(150) not null,
  constraint pk_person PRIMARY KEY(pes_nro_doc)
);
create index ix_person_01 on tb_gen_person (pes_name);

select *
from tb_gen_person
where pes_name like '%albert%';

Not considering upper case, or tsearch2, this type of search use index
somehow?
I overhear that if the search has more than 5 characters, probably would
use index!! Is this true?

Thanks

Responses

pgsql-admin by date

Next:From: Vishal AroraDate: 2007-07-25 16:16:52
Subject: Re: Backup Scheduler...
Previous:From: Jayakumar_MukundarajuDate: 2007-07-25 12:42:40
Subject: Backup Scheduler...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group