Subject Re: [firebird-support] Benefit from Sequential Insert of High/Low PK
Author Helen Borrie
At 10:21 a.m. 26/01/2013, Jeff wrote:
>Hi all,
>(Using FB 1.5)
>Do inserts in FB benefit from ordered or sequential PK?


>Please allow me to clarify. I intend to use High/Low for table PKs.

I don't know what that might be.

>With this approach, it is very possible that PKs will not be in sequential order as they are inserted into the db. Will this be an issue in FB?

Firebird doesn't store row data in any particular order. In fact, it doesn't even necessarily store all row data for a particular table contiguously or even on the same disk. (A Firebird database can be split across multiple physical files.) Firebird cares about "pages" and maintains an inventory of various types of pages in order to locate specified rows and the indiexes, blob data and other stuff. It can't even be said that physical storage order in any way reflects arrival sequence, since Firebird cleans up garbage and releases whole pages and also the space freed on occupied pages for future re-use.

>I based this question on this article:

Despite the author's stating that his article was broader than the MSSQL focus that referenced articles had, he still pitched it at the assumption that all database engines store rows in some intrinsic sort order. Firebird doesn't. I suspect that including Oracle in that bunch was an error, as I believe Oracle does not rely on storage sequence for consistency, either....however, Ann will be able to provide a much better "take" on his approach than I could.