Обсуждение: Clustered index?

Поиск
Список
Период
Сортировка

Clustered index?

От
Stephen Cook
Дата:
I come from a MS SQL Server background, but I am planning on using
PostgreSQL to take over the world in my own way.

What (if it exists) is the equivalent of a clustered index in SQLServer?



Re: Clustered index?

От
Michael Fuhr
Дата:
On Sat, Apr 21, 2007 at 03:22:59AM -0400, Stephen Cook wrote:
> I come from a MS SQL Server background, but I am planning on using
> PostgreSQL to take over the world in my own way.
>
> What (if it exists) is the equivalent of a clustered index in SQLServer?

What does "clustered index" mean in SQL Server?  Here's what it
means in PostgreSQL:

http://www.postgresql.org/docs/8.2/interactive/sql-cluster.html

--
Michael Fuhr

Re: Clustered index?

От
Stephen Cook
Дата:
A clustered index is an index whose leaf nodes (in the b-tree) contain
the data pages, and they are physically sorted on this index.

CLUSTER looks similar, except with PostgreSQL it is not kept sorted,
whereas SQL Server guarantees that the data stays sorted on this index
(by definition).  So with one you pay a bit for any insert that does not
belong at the end, while with the other you have to periodically pay all
at once (re-cluster) for the same conditions.

Thanks for the link, somehow I missed that when I was reading through
the documentation.  It is a bit weird getting my head around this after
dealing with only one vender for several years.




Michael Fuhr wrote:
> On Sat, Apr 21, 2007 at 03:22:59AM -0400, Stephen Cook wrote:
>> I come from a MS SQL Server background, but I am planning on using
>> PostgreSQL to take over the world in my own way.
>>
>> What (if it exists) is the equivalent of a clustered index in SQLServer?
>
> What does "clustered index" mean in SQL Server?  Here's what it
> means in PostgreSQL:
>
> http://www.postgresql.org/docs/8.2/interactive/sql-cluster.html
>