How can i use slice with SQL query?

Hi,

I want to get read many records at once,
I use SQL to get it much faster.
now I want to use parallel requests to improve the performance even more,
so I tried to use sliced scroll with SQL

like this:
POST _opendistro/_sql/
{
“fetch_size” : 9999,
“keep_alive”: “1m”,
“slice”: {
“id”: 0,
“max”: 2
},
“query”: “SELECT * FROM demo_index”
}

and

POST _opendistro/_sql/
{
“fetch_size” : 9999,
“keep_alive”: “1m”,
“slice”: {
“id”: 1,
“max”: 2
},
“query”: “SELECT * FROM demo_index”
}

I don’t get any error,
but I don’t think it’s working - I get all the records for both of the queries…

1 Like