Information générale
Catégorie:
Codage, syntaxe et commandes
Nadya:
Sorry for not being precise: performance is about the same if you have to build the index. GetMedian is MUCH faster if the index already exists. I played a little bit with your functions and I came up with a few things.
Note 1
------
In GetMediam, you have to change one line from
lnMedianValue=evaluate(lcTableName + '.' + pcField)
to
lnMedianValue=evaluate(lcCursor + '.' + pcField)
in order to work.
Note 2
------
In GetMedianValue, you should have two distict SELECT SQL statements:
One with the WHERE clause and one without. This will increase performance if tcWhere is empty.
Note 3
------
GetMedian cannot have an equivalent FILTER clause because its logic breaks down if one record is filtered out (including current filter) or if a record is deleted.
I personnally stay away from stuff like GetMedian because it requires some housekeeping code. I tend to write stuff in SQL because I find it much easier to debug and maintain.
My .02 worth,
Daniel
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement