This message was deleted.
# troubleshooting
s
This message was deleted.
v
the error bounds can vary depending on the size of the sketch use
Copy code
HLL_SKETCH_ESTIMATE_WITH_ERROR_BOUNDS(ds_HLL(tmp_hash, 4, 'HLL_4'),3)
to get the upper and lower bounds in the 3 sigma limit.
k
thanks. but whats the logic behind this. i would have imagined that with lgk=4, we would use lesser no of bits to represent the aggregate field and hence would get less no of unique values. I cannot imagine why the could would go up!
b
I don't understand all the math, but estimates can be off both ways - over or under. I think of it as, OK I have a few hash values here, from that, guess how many of the inputs were actually unique? I get that it's kind of surprising that it doesn't remember that it started with 50 values, so it must be less than 50, but afaict it doesn't. Seems like a good question for #datasketches in ASF slack, so I just asked there - https://the-asf.slack.com/archives/CHWKFEHUZ/p1678136969191449
Here's a response from there:
Alexander Saydakov [1:48 PM] keeping this count is an extra resource. what are the chances that it is going to help? usually the distinct count is much less than total count. I would suggest to start from a desired accuracy. Say, you want to be within 1% with 95% confidence. That translates to a particular K. Unbiassed estimate means it is as likely to overestimate as underestimate, and that is a good property. In some rare cases in some particular circumstances the estimate might be higher than total count. Why do you think it is a problem if you are guaranteed to be, say, within 1% with 95% confidence?
So, it's by design
k
thanks Ben, i didnt know about that channel and dont have access, so thanks for carrying it forward. "within 1% with 95% confidence" - where can i find a source on this info to understand this more?
Am i reading the lgK=4 chart right?
Copy code
LgK=4, LgT=20, factor=.83266, RSE=0.20
The above means that with +/- 2 Standard Deviation, for 95.4% confidence, will have error “bounds” of -30% to +50% , if no.of unique values start crossing 8 in the data set?
g
with
APPROX_COUNT_DISTINCT_DS_HLL(tmp_hash, 4, 'HLL_4')
you have lgK = 4; a very small value, so you'll get high error
i'm wondering why you're wanting to use lgK = 4?
the default is 12 which is pretty balanced between size/speed/accuracy
an error table i made for a talk last year
the table doesn't go below 10 because the errors are too high imo
k
"i'm wondering why you're wanting to use lgK = 4?" well, I am using groupBy queries and they being resource intensive, crashed at lgk=12 with wanting more aggregate buffer space. Asking for more buffer space from the OPS team for my druid prod servers is also a big task. So i started looking into the queries and found a variable to tweek. and brought the lgk down to 4 from 12. which worked. Now that i know what it does, i would revert it back to 12 and also look into the topN queries. 🙂
"an error table i made for a talk last year" Also, can i have link to the talk, if its public.
g
it wasn't recorded but i hope to do a recorded one at some point!
ah, got it. i guess you got a resource limit exceeded error?
you could also ask your ops team to enable disk spilling using
druid.query.groupBy.maxOnDiskStorage
k
I am afraid that might add disk-io latencey to an already heavy query - 25s currently with a ui timeout of 30s. Also, it would result in regression + perf. testing all the other existing queries. I want to keep the impact to a minimum. So looking into replacing groupBy with topN
v
you could page to disk and enable parallel combine in the historical. This could get you some performance benefit if the merge across segment results is the bottle neck
k
Thanks Gian and Vijay Some observations: case1: druid.query.groupBy.maxOnDiskStorage=1Gb response time: 63s case2:
druid.query.groupBy.maxOnDiskStorage=1Gb + “numParallelCombineThreads”:10
response time: 97s Latency seems to be increasing
g
yeah that's good to know! based on other cases i've seen, i'm not sure parallel combine actually helps in most cases. we're thinking about moving away from that and toward a different approach for big groupBys
v
is tmp_hash a number or guid?
k
its a 41 char guid
v
hmmm.....the sketch is a lot faster on number fields. You could convert the guid to a number using a hash function in the pipeline before Druid. This will likely speed up the query a lot