We have an offline Pinot table with 20 columns exp...
# troubleshooting
c
We have an offline Pinot table with 20 columns experiencing high latency or timeout when query it with large offset: e.g. 1000000. some of the columns has large text: e.g. 50000 chars. Is there some thing we could change to help improving the query latency?
m
what does the query look like?
x
why query with large offset?
c
Typically Select * from table where timecolumname < somedate order by id limit 20 offset 1300000.
Is a pagated query from UI support retrieve data from over 2 million records.
x
since it’s order by and offset, I think the broker will retrieve 1.3 million rows then give you 20
so it’s expected to be long waiting time
c
Yeah that make sense. But Is there anything we can optimize other than remove the ordering?
k
You want to use something with time
c
You mean ordering only by the field configured as timecolumnname?
m
Perhaps break query down into smaller queries for time ranges
k
sorry, got distracted and forgot to write the full solution
Think of adding an additional where clause for time in the query
Select * from table where time < some date and time > prev max date fetched limit 10000
First time u run the query you can set prev-Max to 1970 or not have that predicate
After you fetch the result for the first 10000, use the max time from the result
And put that in the next query
Hope you get the idea