Fork me on GitHub
#datomic
<
2022-09-20
>
Drew Verlee14:09:58

Thanks for the clarification

☺️ 1
uwo15:09:28

I just want to make sure my testing is correct here: You can't use db-stats together with d/as-of to get a picture of earlier datom counts, correct?

souenzzo13:09:49

It sounds like a bug for me.

uwo17:09:05

hmm! thanks, I'll go to the proper bug channels then

favila19:09:44

I don't think so. db-stats is the stats of the index, and there's only one index at a time

favila19:09:07

as-of, since, etc are just filters on the index

favila19:09:26

I don't think db-stats could be implemented efficiently if it filtered too

souenzzo19:09:55

it is a great description for a index-stats function. 👀 The db in the past uses only a subset of the index, so db-stats should respect this subset, imho.

favila19:09:01

but to do this it has to descend into the "leaves" of the tree instead of just walking the index nodes

favila19:09:55

you can efficiently give stats for a particular index tier (e.g. all of history, or all of the "now"), but not for subsets of one, which is what as-of/since can do

uwo20:09:24

@U09R86PA4 thanks. Out of curiosity, if you needed to compute the rate of growth of a set of attributes would you use the datoms api or trawl the tx-log? I've implemented my own db-stats using d/datoms that respects as-of+history, but it just takes forever, even though I'm just getting a count for every month the database has been in operation.

uwo20:09:22

I'm guessing that I'm doing a lot of double counting since I'm running the computation for each month. Probably would be more efficient to trawl the tx-log, no?

favila20:09:40

Depends on exactly what you are measuring and why. If you are just looking at a few attr and are mostly interested in index size or churn or sth like that, I'd d/datoms aevt once over an unfiltered history db and bucket by tx myself. You can compute tx intervals for time using avet of db/txInstant

favila20:09:46

If you want everything, or you want to include unindexed info (eg noHistory attr churn) I'd use tx range directly

uwo20:09:38

Oh, lordy -- bucket by tx -- I'm embarrassed for not thinking of that! Thanks @U09R86PA4!!!

uwo21:09:04

Hmm. I see -- if I'm using the :aevt approach it's gonna need to be only for a few attributes. Gonna tx-range since I need more of a global snapshot of what business entities (attr sets) with the largest datom footprints are growing fastest.

uwo16:09:05

this would have been a nice technique for calculating rate of growth (esp. for certain sets of attributes).