From: | "Valentine Gogichashvili" <valgog(at)gmail(dot)com> |
---|---|
To: | "andrew(at)pillette(dot)com" <andrew(at)pillette(dot)com> |
Cc: | pgsql-performance(at)postgresql(dot)org |
Subject: | Re: multicolumn index column order |
Date: | 2007-07-24 07:40:43 |
Message-ID: | 3ce9822f0707240040o2f358155p7ff7537bbe986209@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
On 7/24/07, andrew(at)pillette(dot)com <andrew(at)pillette(dot)com> wrote:
>
> valgog <valgog(at)gmail(dot)com> wrote ..
> > On Jul 23, 7:00 pm, t(dot)(dot)(dot)(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane) wrote:
> > > valgog <val(dot)(dot)(dot)(at)gmail(dot)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...
From | Date | Subject | |
---|---|---|---|
Next Message | Jonathan Gray | 2007-07-24 07:48:07 | Query performance issue |
Previous Message | valgog | 2007-07-24 07:33:55 | Re: disable archiving |