Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id E3EFB9FBC09 for ; Wed, 25 Jul 2007 10:17:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 54811-03 for ; Wed, 25 Jul 2007 10:17:46 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from smtp106.mail.mud.yahoo.com (smtp106.mail.mud.yahoo.com [209.191.85.216]) by postgresql.org (Postfix) with SMTP id E13D79FBB0B for ; Wed, 25 Jul 2007 10:17:46 -0300 (ADT) Received: (qmail 9793 invoked from network); 25 Jul 2007 13:17:45 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.br; h=Received:X-YMail-OSG:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; b=FwUWAx61HnA27Jwp2+gAPg2J2OVNS1BuzCeGH1FYyW1K7OzSWeMTI3rI56sQAtUVoGhuEoX+FFami/AaMmgKhIhpo4pA2GObPtq5AjqVKQuD+/FDQ1+ug2AMaLFpl0X6aGzRYv6KwXb5WosjU1b4utatbTSZ8pyA0fCPLfC3OOM= ; Received: from unknown (HELO ?10.90.2.103?) (burbello3000@200.103.143.8 with plain) by smtp106.mail.mud.yahoo.com with SMTP; 25 Jul 2007 13:17:44 -0000 X-YMail-OSG: wbuD1SsVM1nZW5xAK8yvC3.IRsuknPGOADrseQQS1h1lttoztcLcnXerwuNlgYWiy38_Vg8i8w-- Message-ID: <46A74D75.7000407@yahoo.com.br> Date: Wed, 25 Jul 2007 10:17:41 -0300 From: "Alexander B." User-Agent: Thunderbird 1.5.0.7 (X11/20060911) MIME-Version: 1.0 To: "pgsql-admin@postgresql.org" Subject: Searching in a string with index Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/277 X-Sequence-Number: 26258 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