X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 04ECE4758F1 for ; Tue, 15 Apr 2003 01:55:01 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 227EF474E4F for ; Tue, 15 Apr 2003 01:55:00 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h3F5swU6005354; Tue, 15 Apr 2003 01:54:58 -0400 (EDT) To: "Sigi Jekabsons" Cc: pgsql-sql@postgresql.org, "Stephan Szabo" Subject: Re: fast case-insensitive sort In-reply-to: <005801c302f8$6600a890$7c01a8c0@microvac> References: <20030414191817.L48398-100000@megazone23.bigpanda.com> <005801c302f8$6600a890$7c01a8c0@microvac> Comments: In-reply-to "Sigi Jekabsons" message dated "Tue, 15 Apr 2003 10:40:38 +0800" Date: Tue, 15 Apr 2003 01:54:58 -0400 Message-ID: <5353.1050386098@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-32.3 required=5.0 tests=BAYES_00,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/218 X-Sequence-Number: 12919 "Sigi Jekabsons" writes: > 'surname' is varchar(255), indexed in the manner shown on my > previous post. You're quite right, though, I just tried indexing and > sorting by a column of type text and that worked just fine, it used the > index in the order by. Why is that? I would have said that the presence of the implicit varchar-to-text cast prevented the system from detecting that the expression matches the index value. But if it's able to detect the match in one case and not the other, that might be a garden-variety bug. Will look at it ... regards, tom lane