Re: Function Vs Expressions
- From: "Jose Perdigao" <perdijc@xxxxxxxxxxx>
- Date: Mon, 17 Apr 2006 15:07:29 +0100
Thanks, Your answer was good to don't change my fundamental law.
I know, some time we change code, statement and the performance increase.
But, also I listen to increase the speed, store calculations results. I know
it's easier, but is not programming and the consistency is lower.
jose perdigao
"Klatuu" <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6D19F4FB-1BCF-465D-B695-54A47F3845AE@xxxxxxxxxxxxxxxx
Don't change the idea. Storing calculated values is never a good idea.
What
everyone is trying to explain is the order of preference for which method
you
use.
As Allen Browne said, pure SQL provides the best performance. User
defined
functions are best used when the evaluation of your data would be too
complex
for an expression. I tend to use UDFs when an expression would be
difficult
to understand and maintain. And the last (and slowest) choice is Domain
Aggregate Functions.
For example, just recently, I modified the code for a query that had up to
six DLookUps for each row. It took about two minutes to return a
recordset
from a table with less than 7000 rows. By restructuring the query's SQL
and
removing the DLookUps, the recordset now returns in under two seconds.
"Jose Perdigao" wrote:
So, if I understood, is good idea using domain aggregate function in the
form to entry data and from the calcultaion result store it in a field.
make
sense this ratiocination?
Normally, i don't store the calculations results to save memory, but I
think, I must change this ideia.
Thanks
José Perdigão
"Rick Brandt" <rickbrandt2@xxxxxxxxxxx> wrote in message
news:GjL0g.48008$_S7.12044@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Jose Perdigao wrote:
I don't understand why domain aggregate functions is slower than
expressions, they should be faster because is aggregated in access.
There is overhead associated with the use of a domain aggregate
function.
When used singularly in code or a form/report expression this overhead
is
not an issue. When used in a loop or a query that overhead is incurred
for each and every row or loop iteration and then it becomes a
significant
performance problem.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
.
- References:
- Function Vs Expressions
- From: Jose Perdigao
- Re: Function Vs Expressions
- From: Allen Browne
- Re: Function Vs Expressions
- From: Jose Perdigao
- Re: Function Vs Expressions
- From: Rick Brandt
- Re: Function Vs Expressions
- From: Jose Perdigao
- Function Vs Expressions
- Prev by Date: Re: Function Vs Expressions
- Next by Date: Re: DoCmd.TransferSpreadsheet
- Previous by thread: Re: Function Vs Expressions
- Next by thread: Control Tip Text
- Index(es):
Relevant Pages
|