Subject Re: [firebird-support] Preformance without 'Temporary Tables'
Author Arno Brinkman
Hi,

> > Could you show us your PLAN please.
>
> PLAN (A ORDER ACTION_TIC)
> PLAN (U NATURAL)

Well that's good.

> > And in fact don't you want to do this then instead of running 6 queries
:
> >
> > UPDATE
> > ACTIONS U
> > SET
> > U.SERVED = U.SERVED /
> > (SELECT Count(*) FROM ACTIONS A WHERE A.TICKET_REF = U.TICKET_REF)
>
> Only reason I did not run that at first was that 80000 of
> the 140000 records the count is 1, so I was just trying to
> remove unnecessary updates!
> I was simply surprised when my 'obvious' approach failed.

Yes, but ACTIONS U will always visit every record, so this is porbably much
faster as executing 7 queries with hardcoded number.

> Now how on earth do I find out why it was not working for
> the last 24 hours :)

It seems the index and data was heavily fragmented.
If it happends again try deactivate/activate the index, this will rebuild
the index.

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird links :
http://www.firebirdsql.com
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/


Nederlandse firebird nieuwsgroep :
news://80.126.130.81