Hello Mark

Thank you for your answer.

So, the clause ORDER BY should be used just when the table has few rows?

Because if do not use the indexes does not make sense to use it with big
tables.

Greetings.

Walter.





On Fri, Mar 1, 2013 at 8:41 AM, Mark Rotteveel <m...@lawinegevaar.nl> wrote:

> **
>
>
> On Fri, 1 Mar 2013 08:32:09 -0400, W O sistemas2000profesio...@gmail.com>
> wrote:
>
> > But the strange thing is that PER_IDENTI is the Primary Key and ORDER BY
> > seems not use it.
>
> As Firebird is retrieving all rows anyway, there is - AFAIK - no benefit
> 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
>
>  
>


[Non-text portions of this message have been removed]



------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu.  Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-support-dig...@yahoogroups.com 
    firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to