Subject | Re: [ib-support] PLAN |
---|---|
Author | Ivan Prenosil |
Post date | 2001-05-17T12:13:59Z |
> I've created a query that is making a SUM of some records. I've checkedInterbase needs to visit all records that participate in aggregate function.
> the PLAN and I noticed that it is using NATURAL sort order. I guess that
> is normal for aggregate functions ? Is it better to avoid using SUM then ?
> Performance ?
E.g. if you do SUM of values from all records of table, then all records must be
internally read (->plan NATURAL); it is not possible to read these values from index
(because of MGA architecture).
On large tables it can really cause a problem with performance.
Either avoid using SUM, or limit number of rows with WHERE clause,
or implement some kind of caching summed values, ...
Ivan
prenosil@...
http://www.volny.cz/iprenosil/interbase