Subject Re: [firebird-support] Re: How to plan a query
Author Dmitry Yemanov
danyschaer wrote:
>
> Preparing query: select m1."PROC",m1."FECH",m1."HORA",m1."DSCR"
> from "MOVI" m1 where m1."FECH"=(select max(m2."FECH") from "MOVI" m2
> where m2."PROC"=m1."PROC" and m2."TIPO" = '1' and m2."HECH" = 'P')
> and m1."TIPO" = '1' and m1."HECH" = 'P'

I see no way to use the index MOVI_PRFE (or whatever including column
"FECH") for the outer table "M1". It's possible for the inner table "M2"
but it's going to be worse than the index MOVI_PROC anyway.

Could you please post the appropriate plans for PostgreSQL?


Dmitry