Subject Re: [firebird-support] Select performance
Author Martijn Tonies
Hi,

> I've checked performance analysis done by IBExpert and noticed curious
> thing:
>
> select * from TABLE
> results in n non-indexed reads
>
> select * from TABLE order by PRIMARY_KEY_FIELD
> is n indexed reads.
>
> Is there real performance difference?

The latter will return the rows in a specific order, but needs to read
the index (on disk) AND the actual row, but hey, you wanted your
resultset ordered.

The first one "just" returns rows.

There's not only a performance difference, but also difference in the
order its returning the resulting rows.

With regards,

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com