in reply to Re: Totaling Time
in thread Totaling Time

I have some comments to add: specifically, about using the database date/time format/type.

If you are going to do any sort of transformation/computation of date/time within perl, I recommend storing the data as an integer ( seconds since epoch time ) in order to reduce overhead.

You may argue that you can do this transformation in the SQL statements, but it's still a huge performance hit ( as far as I could tell ) when you are dealing with tens and hudreds of thousands of record which each needs to have the epoch time format in order to do some calculations

In my case, I needed to fit a certain API that expected epoch time to do its processing. I tried it with a) store date/time in db format, covert upon fetch b) sotre data/time in db format, convert from within SELECT statement c) store data/time as seconds since epoch time, no conversion

This yielded in roughly a) and b) taking the same amount of time, where as c) took about half of the time that it took for a) and b).

So, depending on your application, I strongly urge you to use epoch time instead of native date/time format