Can I use limit and offset these two h2 features for pagination

classic Classic list List threaded Threaded
4 messages Options
kcheng.mvp kcheng.mvp
Reply | Threaded
Open this post in threaded view
|

Can I use limit and offset these two h2 features for pagination

I know in h2 standalone mode, we can use *limit* and *offset*
features(functions) for pagination. Not sure in ignite I can still use these
two function for same purpose?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Stanislav Lukyanov Stanislav Lukyanov
Reply | Threaded
Open this post in threaded view
|

RE: Can I use limit and offset these two h2 features for pagination

`limit` and `offset` should work, with usual semantics.

 

Thanks,

Stan

 

From: [hidden email]
Sent: 11 октября 2018 г. 18:59
To: [hidden email]
Subject: Can I use limit and offset these two h2 features for pagination

 

I know in h2 standalone mode, we can use *limit* and *offset*

features(functions) for pagination. Not sure in ignite I can still use these

two function for same purpose?

 

 

 

--

Sent from: http://apache-ignite-users.70518.x6.nabble.com/

 

kcheng.mvp kcheng.mvp
Reply | Threaded
Open this post in threaded view
|

RE: Can I use limit and offset these two h2 features for pagination

Thank you reply very much!


in standalone h2 mode, if want to make `limit` and `offset` work correctly
the sql must be take a `order` clause.

as I can't find document address how h2 works in ignite cluster.(I just know
it works something like map-reduce.

so I guess if `limit` ,`offset` and `order` happens in the `reduce` phrase
then it might be work.

not sure my understanding is correct or not.
 



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Stanislav Lukyanov Stanislav Lukyanov
Reply | Threaded
Open this post in threaded view
|

RE: Can I use limit and offset these two h2 features for pagination

Yep, `order by` is usually needed for `limit`, otherwise you’ll get random rows of the dataset

as by default there is no ordering.

 

If I’m not mistaken, in Ignite this options work on both map and reduce steps.

E.g. `limit 100` will first take the 100 rows from each node, then combine them in a temp table

on the reducer node and take the first 100 rows from the combined set.

 

Stan

 

From: [hidden email]
Sent: 11 октября 2018 г. 19:32
To: [hidden email]
Subject: RE: Can I use limit and offset these two h2 features for pagination

 

Thank you reply very much!

 

 

in standalone h2 mode, if want to make `limit` and `offset` work correctly

the sql must be take a `order` clause.

 

as I can't find document address how h2 works in ignite cluster.(I just know

it works something like map-reduce.

 

so I guess if `limit` ,`offset` and `order` happens in the `reduce` phrase

then it might be work.

 

not sure my understanding is correct or not.

 

 

 

--

Sent from: http://apache-ignite-users.70518.x6.nabble.com/