Subject | Re: [ib-support] Re: using inclusive indices |
---|---|
Author | Raymond Kennington |
Post date | 2002-11-26T06:55:15Z |
mikeevteev wrote:
specific sequence.
SELECT Field_A FROM TheTable
ORDER BY Field_A
It had indeed optimised your query! :)
--
Raymond Kennington
Programming Solutions
W2W Team B
>It is necessary to specify a WHERE clause or ORDER BY clause in order to give the optimiser a reason to provide a
> Hi!
>
> Table is ... just a table. Nothing special, just a lot of char fields.
> Main point is it has index, lets say on field named field_a.
>
> Query is stupid of cource: select field_a from table
>
specific sequence.
SELECT Field_A FROM TheTable
ORDER BY Field_A
> I just guess that reading index is cheaper then reading all data pagesAs you didn't specify that order mattered, the query returns the result in the fastest possible way.
> in that case, becouse index cover all fields in query.
> But optimizer select plan with natural.
>
It had indeed optimised your query! :)
> Another question related to optimazer.This indicates that no order is specified, i.e. not sorted.
> Table is same.
> Query select field_a from table
> Optimizer plan SORT(table NATURAL).
>
> Why SORT? Here is index already. All fields is covered!
--
Raymond Kennington
Programming Solutions
W2W Team B