very helpful, thanks. I use `order by (symbol, side, orderingpx, serial)` 
to approach just now.  

On Monday, July 6, 2020 at 11:27:44 PM UTC+8, Evgenij Ryazanov wrote:
>
> No, you can't rely on such behavior. For example, it will be broken in 
> you'll add a smaller index with symbol and side columns.
>
> I missed, however, the WHERE clause in your query. With such clause when 
> only one value is allowed in symbol column and only one value is allowed 
> in side column your index on (symbol, side, orderingpx, serial) can be used 
> for ORDER BY orderingpx, serial, but query execution planner of H2 is not 
> that smart, you need to rewrite your ORDER BY clause as 
> ORDER BY symbol, side, orderingpx, serial
> to help it.
>
> The related issue is here:
> https://github.com/h2database/h2database/issues/210 
> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fh2database%2Fh2database%2Fissues%2F210&sa=D&sntz=1&usg=AFQjCNHaa6t68EBSwFY7TofRHgN2X4XBRw>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/314eab9b-8bb0-4e5e-b258-d34ac9ea304ao%40googlegroups.com.

Reply via email to