Re: not sorted clustered index (8.2)

Lists: pgsql-bugs
From: Adriaan van Kekem <avkekem(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: not sorted clustered index (8.2)
Date: 2007-11-05 09:39:37
Message-ID: 472EE4D9.8050904@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

hi,

As part of the definition of a clustered index, the default sort of a
table is based on the clustered index. In our application sometimes we
see that the sort is invalid. Our table is like:
iid identity (clustered primary key)
data varchar
if we do a query like:
select * from table where iid in (1,2,3)

we suspect that we get the result based on the iid, but sometimes this
is not happening. Is this a known issue?
our configuration is postgresql 8.2 on ubuntu

greetings,

Adriaan


From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: Adriaan van Kekem <avkekem(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: not sorted clustered index (8.2)
Date: 2007-11-05 09:51:41
Message-ID: 472EE7AD.20402@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Adriaan van Kekem wrote:
> hi,
>
> As part of the definition of a clustered index, the default sort of a
> table is based on the clustered index. In our application sometimes we
> see that the sort is invalid. Our table is like:
> iid identity (clustered primary key)
> data varchar
> if we do a query like:
> select * from table where iid in (1,2,3)
>
> we suspect that we get the result based on the iid, but sometimes this
> is not happening. Is this a known issue?
> our configuration is postgresql 8.2 on ubuntu

this is not a bug - your application should not depend on a particular
sort order without using ORDER BY.
That this works in other RDBMS is an artefact of their implementation
and you should probably not rely on that (and keep in mind that
clustering is a on-time operation in postgresql so modifications to the
table will change the ordering again)

Stefan