Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id C1A93D84656 for ; Fri, 8 Jun 2012 08:11:31 -0300 (ADT) Received: from 62-2-77-205.static.cablecom.ch ([62.2.77.205] helo=mail.mnc.ch) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Scx6G-0005qm-4m for pgsql-performance@postgresql.org; Fri, 08 Jun 2012 11:11:31 +0000 Received: from localhost (kolab.op.lan [127.0.0.1]) by mail.mnc.ch (Postfix) with ESMTP id 183A966006 for ; Fri, 8 Jun 2012 13:11:13 +0200 (CEST) X-Virus-Scanned: by amavisd-new at mnc.ch Received: from mail.mnc.ch ([127.0.0.1]) by localhost (mail.mnc.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nY9Gpc7Heyf8 for ; Fri, 8 Jun 2012 13:11:12 +0200 (CEST) Received: from localhost (kolab.op.lan [127.0.0.1]) by mail.mnc.ch (Postfix) with ESMTP id 7BB0C662C3 for ; Fri, 8 Jun 2012 13:11:12 +0200 (CEST) Received: from gc.localdomain (62-2-77-204.static.cablecom.ch [62.2.77.204]) by mail.mnc.ch (Postfix) with ESMTP id 5AD7166006 for ; Fri, 8 Jun 2012 13:11:12 +0200 (CEST) Received: by gc.localdomain (Postfix, from userid 500) id C31081874C1; Fri, 8 Jun 2012 13:11:11 +0200 (CEST) To: pgsql-performance@postgresql.org Subject: non index use on LIKE on a non pattern string From: Guillaume Cottenceau X-Hashcash: 1:21:120608:pgsql-performance@postgresql.org::E62EM7kSXly5cuLC:000000000000000000000000000009ngQ Date: Fri, 08 Jun 2012 13:11:11 +0200 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/38 X-Sequence-Number: 47064 Hello, I have noticed that with a SELECT query containing the following constraint: column LIKE ? and an index on that column, PostgreSQL will not use the index even if the parameter doesn't contain special pattern characters such as %.