Hey I have quick question when I run the query ser...
# troubleshooting
n
Hey I have quick question when I run the query server is taking 6 sec to compute the value but browser took 3 min to download the 72mb data any inputs please ?
k
2 things • Serializing 72mb json will take some time.. • There is additional time to transport that data. Having said that 6 minutes is a lot. Is your client and server in different regions?
n
Yes
Correct
Servers in NAM and client is from EMEA
Any solution for this ?
@Kishore G
@Mayank any suggestions here ?
j
for more context, the query in question projects a couple grouped fields followed by >40 aggregated fields and predicate is just a time range. this kind of feels like a good candidate for a star-tree index
but unsure about data size explosion
m
StarTree index won't reduce the response size. What's the query you are running?
j
correct - but it should cut down the server processing time which is still avg 20 seconds and worst cases of several minutes
I cannot share the exact query but it is a relatively straightforward select with lot of aggregations select y1, y2, y3, sum(x1), sum(x2), …., sum(x30), avg(x31), avg(x32), …, avg(x38) from myTable where date between January 1 and March 30 group by y1, y2, y3
m
It will cut down the query time if number of groups is not extrememly high. Note, ST index will only be able to pre-aggregate per group of y1,y2.y3. And if there's millions of those groups, typically there won't be many records per group to aggregate.
We have discussed returing a gzipped response. Perhaps if you are interested in contributing, that would be a great addition
j
hmm on a quick test a 64mb response became 22mb which is not bad - this would prob involve changes on Query Console UI, pinot clients, and the /sql endpoint itself right?
i see we have about <100k groups, just trying to gauge what is extremely high 😅
m
How many rows selected? If you selected 100k rows, and there are 100k groups, then there's nothing for ST index to pre-aggregate.
j
soo this depends on the date range, every group has one row for every day so between 1 and 360 rows per group in a query which can be pre-aggregated ill go ahead and clone the table and see what kind of result we get in terms of data size and docs scanned in a query
k
you can compress it based on the query option output_compression=gzip or something like that
I would also suggest the response is still a JSON but only compress the data part.. we can put the compression as part of the response json metadata
j
I see, I figured something like the Content-Encoding: gzip header and letting the browser/http client handle the whole json but compressing only the data part + metadata field makes sense for compatibility reasons
k
right. I think we can make both options work. we just have to pick the one thats least invasive on the clients