Received: from mta05-svc.ntlworld.com (mta05-svc.ntlworld.com [62.253.162.45]) by postgresql.org (Postfix) with ESMTP id 30FC4474E71 for ; Sat, 13 Jul 2002 05:53:11 -0400 (EDT) Received: from Wilbur ([80.2.246.217]) by mta05-svc.ntlworld.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with SMTP id <20020713095312.HKPZ28874.mta05-svc.ntlworld.com@Wilbur> for ; Sat, 13 Jul 2002 10:53:12 +0100 Message-ID: <000901c22a53$206e0ad0$0500a8c0@Wilbur> From: "Julian Scarfe" To: Subject: Indexes with LIKE Date: Sat, 13 Jul 2002 10:53:23 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Archive-Number: 200207/200 X-Sequence-Number: 8579 I've noticed a difference in behaviour between a server running version 6.x and one running 7.2.1 in use of indexes with LIKE. With an index on foo, WHERE foo LIKE 'bar%' uses the index (as I would expect it to) on the 6.x box, but uses a sequential scan (really slow) on the 7.2.1 box. It's possible that I've set (or failed to set) a run-time parameter that controls the behaviour, but I don't know what that might be. ANALYZEing the table doesn't modify the behaviour. I can't find any mention of this in the documentation -- any pointers would be appreciated. If the above doesn't ring any bells, I'll put together an example. Many thanks Julian Scarfe