Concerning the aggregation, no – I am
not running aggregate functions on the database itself. Let’s take a small example.
Let’s say I am aggregating avg ping time on an hourly basis. I have, inside the table declarations, structures
with an array[24]. As data comes in, I retrieve the test
record for the particular test, based on the test time I establish which array
offset needs to be taken care of, and then perform the relevant computatis. For example, I have a testcounter array
and a testresult array. When a new event comes in, average is going to be
(testresult[n] * testcounter[n] + newvalue) / testcounter[n] + 1, followed by a
testcounter[n] += 1. So I am not loading the database doing aggregate
functions. On our UI side of things, now that
everything is working properly, I am also optimizing code. The current
test code was looping through an array elemnt and aggregating through the
backend. Of course, this is inefficient since, for example, let’s
say I am showing an hourly graph, now I have 24 selects going on. Right
now we are recoding to have one select which will return the aggregate of all
of the offsets at once. It would be great if we could aggregate an array
in one hot, but in the meantime we’ll do it this way. From: Scott Marlowe
[mailto:[EMAIL PROTECTED] I'm
putting both the private email and the thread back on the list, as |
Title: Re: [ADMIN] New system recommendations