Subject Re: [firebird-support] does FB support clustered indices?
Author Alexandre Benson Smith
judlian23 wrote:
> Hi everyone,
>
> I saw on a post from 2006 that FB does not support clustered indices.
> I am currently using Firebird-2.1.1.17910-0_Win32_embed. Does this
> version support clustered indices? I did not see it in the SQL:2003
> standard, but then again, that nuances of that version of SQL is a
> little foreign to me.
>

No... And it's not necessary

> What I mean by clustered is that I need records placed in my DB in
> order. I want them sorted by time, and these records will be inserted
> by time, so hopefully inserts would be fast with a clustered index
> because the db just needs to append the record.
>

In fact it will degrade performance if the databas eengine holds page
locks.. because the "end" of the table would be a hot spot.

FB store the records with no specific order inside the pages, and it
would be the fastest way.

Clustered indices are not supposed to improve insert speed but to
improve search speed, once all near values would be on the same page or
contiguous space.

FB uses a two phase index scan that works almos like a clustered index.

First it read the index pages to find the data pages where the data
potentially fits the search criteria, after that it mounts a bitmap of
the datapages that must be read, and read the datapages on storage
order, so it will perform like a clustered indice, but for ALL the
indices and not for one in particular.

> Please let me know.
>
> Thanks,
> Julian
>

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br