On Mon, 7 Sep 2015 14:00:27 +0100, Tim Ward t...@telensa.com [firebird-support]
wrote:
> Please can someone explain to me, again, why
>
> select Max(MYCOL) from MYTAB
>
> doesn't use the primary key
>
Because Firebird indexes are unidirectional - it cannot
start from end and move ba
> El 7/9/2015, a las 15:00, Tim Ward t...@telensa.com [firebird-support]
> escribiĆ³:
>
> Please can someone explain to me, again, why
>
> select Max(MYCOL) from MYTAB
>
> doesn't use the primary key
>
> PLAN (MYTAB NATURAL)
>
I think you need to have a descending index in order to use it f
You need to use a descending index for it (pk can be descending also).
Also change your sql to:
Select first 1 mycol from mytab order by mycol desc
This will have the spected result.
Em 07/09/2015 10:00, "Tim Ward t...@telensa.com [firebird-support]" <
firebird-support@yahoogroups.com> escreveu:
Please can someone explain to me, again, why
select Max(MYCOL) from MYTAB
doesn't use the primary key
PLAN (MYTAB NATURAL)
Current memory = 3074072
Delta memory = -20
Max memory = 3217516
Elapsed time= 0.27 sec
Buffers = 150
Reads = 1811
Writes 0