Subject Re: can someone explain me
Author svanderclock
so :

Select
First 15
ID,
rank
FROM GEO_PLACE
WHERE
ID = 'RU'

geo_place
indexed read: 4
non indexed read: 0

rdb$procedure
indexed read: 0
non indexed read: 82


Select
First 1
ID,
rank
FROM GEO_PLACE
WHERE
ID like 'R%'

geo_place
indexed read: 542167
non indexed read: 0

rdb$procedure
indexed read: 0
non indexed read: 82


why so much indedxed read in the second variante ?? the result is the same...

thanks by advance for you advice !
stephane

--- In firebird-support@yahoogroups.com, "Leyne, Sean" <Sean@...> wrote:
>
> Stephane,
>
> > => time taken 2ms
> > PLAN (GEO_PLACE INDEX (RDB$PRIMARY24))
>
>
> > => time taken 1230ms
> > PLAN (GEO_PLACE INDEX (RDB$PRIMARY24))
>
>
> > => time taken 80ms
> > PLAN (GEO_PLACE INDEX (RDB$PRIMARY24))
> >
> >
> > Why with the like clause it's soo long ??
>
> The PLAN does not explain all aspect of how the engine is
> operating/evaluating a condition, it only indicates which index is being
> used.
>
> It is most likely that the LIKE command needed to read more index pages
> in order to resolve the result.
>
> Your 2nd LIKE statement was faster simply because it used the same pages
> which were loaded the computer memory/cache from the first query, so it
> ran faster.
>
> The full details of the number of disk reads, disk fetches are really
> required to explain the performance difference.
>
>
> Sean
>