W dniu 2015-03-12 14:46:00 użytkownik Dmitry Yemanov <firebi...@yandex.ru> 
napisał:
> 12.03.2015 16:13, liviuslivius wrote:
> >
> > i only have question with this:
> >
> > CREATE TABLE XXX
> > (
> > A INTEGER,
> > B INTEGER,
> > C INTEGER,
> > D INTEGER,
> > E INTEGER
> > );
> >
> > CREATE INDEX IXA_XXX__ALL ON XXX(A, B, C, D, E);
> >
> >
> > SELECT
> >     *
> > FROM
> >     XXX X
> > WHERE
> >     X.A=5
> >      AND X.B=6
> >      AND X.C>6
> > Range Scan (lower bound: 3/5, upper bound: 2/5)
> 
> There's an implicit upper bound on {A, B}, the index scan begins past 
> {5, 6, 6, whatever} and continues as long as the key keep starting with 
> {5, 6}, then ends.
> 
> 
> Dmitry
> 
> 

ok then i see that i should look at smallest value ({2}/5 is smaller then 
{3}/5) and then i can determine what happened in query

[1]
Range Scan (lower bound: 3/5, upper bound: 2/5)
[2]
Range Scan (lower bound: 2/5, upper bound: 3/5)

in [1] 2/5 is in upper then 2 fields A, B is accessed equally and 3 field C 
(3/5) is accessed by greater scan
in [2] 2/5 is in lower then 2 fields A, B is accessed equally and 3 field C 
(3/5) is accessed by lower scan

I create tool and must know how to work on "text results"


And one more question 
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?

regards,
Karol Bieniaszewski

------------------------------------------------------------------------------
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