Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 4AFDF9FA601 for ; Tue, 24 Jul 2007 04:40:55 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 77180-01 for ; Tue, 24 Jul 2007 04:40:48 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.227]) by postgresql.org (Postfix) with ESMTP id CD50F9FA425 for ; Tue, 24 Jul 2007 04:40:51 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id l8so1200414nzf for ; Tue, 24 Jul 2007 00:40:50 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=J7cqMSUJiFA9EImZ/sPcENLH9s5YwMNKuAsICbNj+kjtLRkdLYiw9l6OwbbmvbR8YcToTpyKV+YJCwDR9zPK745ep1gNWyyGGGwYpW/o0+f6YkiIj7UJW6x4UI82+QDqr96qSzwS+UAJJvMiTi7MsiNUcLSlmynX8/0RQ9nbLBk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=Geo0TAHintHzh2L4d3RnwIISkcFfBAg7ShNCoLlw5OHRw+CSeETTFlPNx9bnH1pByA/PDf9LORZtVL9AfcfWszMbYRZG0gKAENLKC6cx5jPlDC7iDeor+CJCBc2XCZIuFe+OQMqb43hlnskMUnRPIECbcHsVKYlmVG2kppfNoOU= Received: by 10.141.159.13 with SMTP id l13mr1208048rvo.1185262843682; Tue, 24 Jul 2007 00:40:43 -0700 (PDT) Received: by 10.141.49.1 with HTTP; Tue, 24 Jul 2007 00:40:43 -0700 (PDT) Message-ID: <3ce9822f0707240040o2f358155p7ff7537bbe986209@mail.gmail.com> Date: Tue, 24 Jul 2007 09:40:43 +0200 From: "Valentine Gogichashvili" To: "andrew@pillette.com" Subject: Re: multicolumn index column order Cc: pgsql-performance@postgresql.org In-Reply-To: <200707240710.l6O7AUu24090@pillette.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_45606_14683501.1185262843668" References: <200707240710.l6O7AUu24090@pillette.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/308 X-Sequence-Number: 25992 ------=_Part_45606_14683501.1185262843668 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/24/07, andrew@pillette.com wrote: > > valgog wrote .. > > On Jul 23, 7:00 pm, t...@sss.pgh.pa.us (Tom Lane) wrote: > > > valgog writes: > > > > how to build an multicolumn index with one column order ASCENDING > and > > > > another column order DESCENDING? > > > > > > Use 8.3 ;-) > > > > > > In existing releases you could fake it with a custom reverse-sorting > > > operator class, but it's a pain in the neck to create one. > > I've often gotten what I want by using a calculated index on (f1, -f2). > ORDER BY will take an expression, e.g. ORDER BY f1, -f2. Simpler than a > custom operator. > Yes, this is true, but I do now know how to make text order be reversible? There is no - (minus) operator for text value. By now it is not a problem for me, but theoretically I do not see other chance to reverse text fields order... ------=_Part_45606_14683501.1185262843668 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/24/07, andrew@pillette.com <andrew@pillette.com> wrote:
valgog <valgog@gmail.com> wrote ..
> On Jul 23, 7:00 pm, t...@sss.pgh.pa.us (Tom Lane) wrote:
> > valgog < val...@gmail.com> writes:
> > > how to build an multicolumn index with one column order ASCENDING and
> > > another column order DESCENDING?
> >
> > Use 8.3 ;-)
> >
> > In existing releases you could fake it with a custom reverse-sorting
> > operator class, but it's a pain in the neck to create one.

I've often gotten what I want by using a calculated index on (f1, -f2). ORDER BY will take an expression, e.g. ORDER BY f1, -f2. Simpler than a custom operator.


Yes, this is true, but I do now know how to make text order be reversible? There is no - (minus) operator for text value. By now it is not a problem for me, but theoretically I do not see other chance to reverse text fields order...

------=_Part_45606_14683501.1185262843668--