12.03.2015 17:37, liviuslivius wrote:
>
> SELECT
>       *
> FROM
>       XXX X
> WHERE
>       X.A = 12 AND X.B = 1
> ORDER BY
>       X.A, X.B, X.C, X.D, X.E
>
> PLAN (X ORDER IXA_XXX__ALL)
>
> Select Expression
>      -> Filter
>          -> Table "XXX" as "X" Access By ID
>              -> Index "IXA_XXX__ALL" Range Scan (partial match: 2/5)
>
> as you can see in explained plan we do not see "ordered access"
> Ok index is accessed and there are not another sort
> But may be this will be good to see some hint like -> Index Order 
> "IXA_XXX__ALL" Range Scan (partial match: 2/5)?
> This change nothing from operation POV taken by server but will tell
> something more what is the intention of query. In legacy plan we see this 
> PLAN (X ORDER IXA_XXX__ALL)
> What do you think?

The explained plan is designed to be as low level as possible. An index 
scan is always an index scan and it's always ordered by index key. If 
you see this:

   -> Table "XXX" as "X" Access By ID
     -> Index "IXA_XXX__ALL" Range Scan

then you understand that records are retrieved in the index order, as 
Index Scan directly drives the Table Access. However, when you see this:

   -> Table "XXX" as "X" Access By ID
     -> Bitmap
       -> Index "IXA_XXX__ALL" Range Scan

then you understand that the Index Scan populates the Bitmap which in 
turn drives the Table Access. So records are retrieved out of the index 
order, this implies a WHERE/HAVING condition lookup (INDEX plan) rather 
than the index-order navigation (ORDER plan).

I agree this may be a bit complicated to understand at the first glance, 
but this feature is intended to focus on what really happens, not what 
the query was supposed to do ;-)


Dmitry


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to