Subject RE: [firebird-support] Re: Performance issue
Author Leyne, Sean
Pokka,

> For the 1st SQL after starting FB, the statistics is as follows:
>
> Starting transaction...
> Preparing query: select * from doc where doc_id=1000 order by doc_id
> Prepare time: 00:00:05.
> Field #01: DOC.DOC_ID Alias:DOC_ID Type:INTEGER
> Field #02: DOC.DOC_TYPE Alias:DOC_TYPE Type:INTEGER
> Field #03: DOC.DOC_SUBTYPE Alias:DOC_SUBTYPE Type:INTEGER
> Field #04: DOC.DOC_DATE Alias:DOC_DATE Type:DATE
> Field #05: DOC.DOC_XML Alias:DOC_XML Type:BLOB SUB_TYPE 1
> PLAN (DOC ORDER PK_DOC INDEX (PK_DOC))
>

What is the performance of the following SQL?

select
DOC.DOC_ID,
DOC.DOC_TYPE,
DOC.DOC_SUBTYPE,
DOC.DOC_DATE
from doc
where
doc_id=1000
order by
doc_id


Separately, you know that your ORDER BY clause is redundant/should be
dropped, right?

The DOC_ID is unique, so sorting by the field is simply adding an
extra/unneeded step.


Sean