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 EA393D1B220 for ; Fri, 23 Jul 2004 13:00:23 -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 03726-04 for ; Fri, 23 Jul 2004 16:00:17 +0000 (GMT) Received: from curie.credativ.org (credativ.com [217.160.209.18]) by svr1.postgresql.org (Postfix) with ESMTP id 73EB7D1B1FD for ; Fri, 23 Jul 2004 13:00:13 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by curie.credativ.org (Postfix) with ESMTP id BCC9A55BCD; Fri, 23 Jul 2004 18:00:12 +0200 (CEST) Received: from www.credativ.de (pD9500137.dip0.t-ipconnect.de [217.80.1.55]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by curie.credativ.org (Postfix) with ESMTP id 22E5455BC8; Fri, 23 Jul 2004 18:00:12 +0200 (CEST) Received: from bell.credativ.de (bell.credativ.de [172.26.14.16]) by www.credativ.de (Postfix) with ESMTP id BE6871C0004; Fri, 23 Jul 2004 18:00:08 +0200 (CEST) From: Peter Eisentraut To: "Jouneau Luc" Subject: Re: Seq scan with a like operator Date: Fri, 23 Jul 2004 18:00:07 +0200 User-Agent: KMail/1.6.2 Cc: References: <006d01c470b3$aa0381f0$4703668a@pc502jlo> <200407231654.33879.peter_e@gmx.net> <011e01c470c9$26b637f0$4703668a@pc502jlo> In-Reply-To: <011e01c470c9$26b637f0$4703668a@pc502jlo> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <200407231800.07825.peter_e@gmx.net> X-Virus-Scanned: by AMaViS at credativ.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.2 tagged_above=0.0 required=5.0 tests=RCVD_IN_NJABL, RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/274 X-Sequence-Number: 14342 Am Freitag, 23. Juli 2004 17:24 schrieb Jouneau Luc: > 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 ? Yes. > 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. I think that kind of interface would use the LIKE operator no matter whether the user entered wildcards or not. > It would also mean that support both exact generic queries double the > indexing task on update/insert/delete. Well, if you want to optimize lots of different queries, the system needs to provide lots of different support. -- Peter Eisentraut http://developer.postgresql.org/~petere/