X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8EA85D1B16A for ; Fri, 23 Jul 2004 12:24:35 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 86933-02 for ; Fri, 23 Jul 2004 15:24:31 +0000 (GMT) Received: from jais.jouy.inra.fr (jais.jouy.inra.fr [138.102.1.17]) by svr1.postgresql.org (Postfix) with ESMTP id 1F47ED1B179 for ; Fri, 23 Jul 2004 12:24:30 -0300 (ADT) Received: from diamant.jouy.inra.fr (localhost [127.0.0.1]) by jais.jouy.inra.fr (8.10.1/8.10.1) with ESMTP id i6NFORN09793 for ; Fri, 23 Jul 2004 17:24:27 +0200 (CEST) Received: from pc502jlo (pc502ljo [138.102.3.71]) by diamant.jouy.inra.fr (8.10.1/8.10.1) with SMTP id i6NFOSU22956 for ; Fri, 23 Jul 2004 17:24:28 +0200 (CEST) Message-ID: <011e01c470c9$26b637f0$4703668a@pc502jlo> From: "Jouneau Luc" To: References: <006d01c470b3$aa0381f0$4703668a@pc502jlo> <200407231654.33879.peter_e@gmx.net> Subject: Re: Seq scan with a like operator Date: Fri, 23 Jul 2004 17:24:31 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/273 X-Sequence-Number: 14341 > LIKE requires a different kind of index. See > . Thanks for the answer peter, I didn't notice it when I red the doc, but if I create the index as specified then it is the query with equal operator which use a seq scan. Do I have to create 2 indexes on the same column (with different datatype) in order to support different kind of queries ? Well, It seems quite strange to me : Suppose you have an user interface in which user can parameter his query on 4 varchar fields (independantly, i.e field 4 does not need to have field 1,2 or 3 filled), and you allow to use generic character such as '*' or '?' (which will be translated into '%' and '_'). User can also fill in exact values. Then you would have to create 4*2=8 indexes to handle every combinations of possible queries. It would also mean that support both exact generic queries double the indexing task on update/insert/delete. Am I wrong ? Luc Jouneau