Subject Re: [firebird-support] Re: Why the difference?
Author Mark Rotteveel
On Fri, 1 Mar 2013 09:23:12 -0400, W O <sistemas2000profesional@...>
wrote:
> Hello Dmitry
>
> Writing:
> SELECT * FROM V_ABM_PERSONAS V WHERE V.PER_IDENTI > 0 ROWS 1 TO 100
>
> The plan is:
> PLAN JOIN (JOIN (JOIN (JOIN (JOIN (JOIN (V P ORDER UQ_PERSONAS1 INDEX
> (PK_PERSONAS), V D INDEX (UQ_DEPARTAMENTOS)), V L INDEX
(UQ_LOCALIDADES)),
> V B INDEX (UQ_BARRIOS)), V R INDEX (PK_PROFESIONES)), V S INDEX
> (UQ_SUCURSALES1)), V O INDEX (PK_LOCALES))

It looks like V_ABM_PERSONAS is a relatively complex view?

> It takes 3 seconds, 28 seconds, 41 seconds, 38 seconds, etc. No idea why
> the difference between one execution and other.
>
> Writing:
> SELECT * FROM V_ABM_PERSONAS V ORDER BY V.PER_IDENTI ROWS 1 TO 100
>
...
>
> It takes more then 53 minutes!!! (and counting...)
>
> Writing:
> SELECT FIRST 100 * FROM V_ABM_PERSONAS V ORDER BY V.PER_IDENTI

How long does this query take? Is it similar to the one with ROWS 1 TO
100?

Mark