Re: advanced index (descending and table-presorted descending)

From: "Peter Childs" <peterachilds(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: advanced index (descending and table-presorted descending)
Date: 2006-11-22 08:48:14
Message-ID: a2de01dd0611220048r7e4d4dd5p2c6ba0d4887fb0d7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 21/11/06, Vic Cekvenich <v(dot)cekvenich(at)yahoo(dot)com> wrote:
>
> Can pgSQL 8.x do descending indexes like mySQL 5.1?
> (so 1st column is descending and rest are asscending?)
>
>
> Can pgSQL 8.x do "physically" sorted table (like a forced index order) so we
> don't need order by?
>
> tia,
> .V
>
>

No and I don't really believe mySQL can if it can its a bug, I would
not trust it. If you want your results sorted you need the order
by......

However, Cluster might work for you, but you need to re-cluster after
every updates or inserts, so it will probably be fine for static data.
Which I suspect is the same for mySql but I can't be bothered to
check, If mysql really works like this its worse that I originally
thought it was. Even so I would always include the order by clause for
safety.

(Its a bug because the table(file) will always grow and grow and grow
and eventually take up the entire disk with tonnes of gaps which can
be closed without unsorting the data or rewriting the entire file ie
cluster....)

Peter.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Arnaud Lesauvage 2006-11-22 09:08:21 Re: MSSQL to PostgreSQL : Encoding problem
Previous Message Albe Laurenz 2006-11-22 08:42:28 Re: Vienna migrating some DB's from Oracle to PG