Greetings!

As far as I remember, H2 considers composite indices only in certain
situations -- but not for all possible optimisations.
Please EXPLAIN your query to check, if the index has been considered (I
guess, it has not).

Maybe try again with 2 different indices, one for MEM and one for
SEQUENCE (replacing you composite index).

Good luck
Andreas

On Sun, 2022-12-18 at 02:17 -0800, [email protected] wrote:
> hi
>    i have 20 millions rows , and this index doesn't speed up the
> query, please help:
> 
> create index mem on data(mem, sequence);
> 
> select * from data where mem is not null order by sequence
> 
> mem is varchar(200); and sequence is bigint
> 
> thanks
> -- 
> 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/d23b4ca9-2f9b-4bbe-84dd-b7d8469e129dn%40googlegroups.com
> .

-- 
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/cd57a7444f5009c7883fad2d61ce5fb9ad39df57.camel%40manticore-projects.com.

Reply via email to