Subject | Re: [firebird-support] Why the difference? |
---|---|
Author | Mark Rotteveel |
Post date | 2013-03-01T12:41:57Z |
On Fri, 1 Mar 2013 08:32:09 -0400, W O <sistemas2000profesional@...>
wrote:
to use the primary key index for the ORDER BY. Unlike some other databases,
Firebird does not have clustered indexes so rows are not stored in their
(primary key) index order, and retrieving rows in index order is probably a
lot more inefficient then loading them in storage order and then sorting
(although that is debatable given your dataset size).
Given the size of (3.5 * 10^6) rows versus the use of ROWS 1 TO 100
retrieving those first 100 in index order would probably have been more
efficient in this particular case, but Firebird doesn't seem to do that
(yet?).
Mark
wrote:
> But the strange thing is that PER_IDENTI is the Primary Key and ORDER BYAs Firebird is retrieving all rows anyway, there is - AFAIK - no benefit
> seems not use it.
to use the primary key index for the ORDER BY. Unlike some other databases,
Firebird does not have clustered indexes so rows are not stored in their
(primary key) index order, and retrieving rows in index order is probably a
lot more inefficient then loading them in storage order and then sorting
(although that is debatable given your dataset size).
Given the size of (3.5 * 10^6) rows versus the use of ROWS 1 TO 100
retrieving those first 100 in index order would probably have been more
efficient in this particular case, but Firebird doesn't seem to do that
(yet?).
Mark