X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 8E5D547580B for ; Mon, 14 Apr 2003 22:21:11 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 982D4474E44 for ; Mon, 14 Apr 2003 22:21:07 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 31DF1D614; Mon, 14 Apr 2003 19:21:45 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 278B35C04; Mon, 14 Apr 2003 19:21:45 -0700 (PDT) Date: Mon, 14 Apr 2003 19:21:45 -0700 (PDT) From: Stephan Szabo To: Sigi Jekabsons Cc: Subject: Re: fast case-insensitive sort In-Reply-To: <002e01c302e8$db771ab0$7c01a8c0@microvac> Message-ID: <20030414191817.L48398-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-16.3 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO 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/216 X-Sequence-Number: 12917 On Tue, 15 Apr 2003, Sigi Jekabsons wrote: > I'm having trouble getting postgres to use an index when doing an ORDER BY > UPPER(surname), for instance. I can create an index on UPPER(surname), but > it doesn't use it in the query - is there a better way of doing a fast case > insensitive sort? What's the table look like (what type is surname)? I can get behavior like this using a varchar, but it uses the index when the field is declared as text.