Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id CDAF337C9E9 for ; Mon, 6 Oct 2008 20:59:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 21560-08 for ; Mon, 6 Oct 2008 20:59:49 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by postgresql.org (Postfix) with ESMTP id 3E00537BD17 for ; Mon, 6 Oct 2008 20:59:49 -0300 (ADT) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Mon, 06 Oct 2008 18:59:46 -0500 Message-Id: <48EA6015.EE98.0025.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.3 Date: Mon, 06 Oct 2008 18:59:33 -0500 From: "Kevin Grittner" To: "Greg Caulton" , Subject: Re: cant get an index scan with a LIKE References: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200810/30 X-Sequence-Number: 31611 >>> "Greg Caulton" wrote: > but I get a sequential scan when I do where term_index like > > select * from sct_descriptions where term_index like 'CHILLS AND FEVER > (FINDING)' > Is there anything else I can do? Settings below, this is PostgreSQL 8.3 > "lc_collate";"English_United States.1252" > "lc_ctype";"English_United States.1252" > "lc_messages";"English_United States" > "lc_monetary";"English_United States" > "lc_numeric";"English_United States" > "lc_time";"English_United States" This issue is discussed here: http://www.postgresql.org/docs/8.2/interactive/locale.html with a solution to your specific problem mentioned here: http://www.postgresql.org/docs/8.2/interactive/indexes-opclass.html You can create an index with the appropriate operator type to get LIKE to work as you want. I hope this helps. -Kevin