Re: [h2] how much indexes are used for optimization

2024-04-07 Thread Noel Grandin
Run the EXPLAIN command to see which indexes are used for a specific query

-- 
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 h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/CAFYHVnUU91ByuWeNANFe-cS3_1cWovMx%3DXHmoeMEzO-W13M-EA%40mail.gmail.com.


Re: [h2] how much indexes are used for optimization

2024-04-07 Thread 'Christian Buchegger' via H2 Database
"more than one index could be used" in that context means: the optimizer
may choose from more than one index but finally has to use only one of
theese.

To my knowledge the optimizer considers all available indexes an decides
based on the cost.

In short all indexes are used to calculate the cost and only one is finally
used to access the data.

Hope this helps.


Rinse Lemstra  schrieb am Fr., 5. Apr. 2024, 18:50:

>
> from the H2 website:
>
> If a table has multiple indexes, *sometimes more than one index could be
> used.* Example: if there is a table TEST(ID, NAME, FIRSTNAME) and an
> index on each column, then two indexes could be used for the query SELECT
> * FROM TEST WHERE NAME='A' AND FIRSTNAME='B', the index on NAME or the
> index on FIRSTNAME. It is not possible to use both indexes at the same time.
>
> In what conditions more then one index can be used?
>
> regards,
>
> Rinse
>
> --
> 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 h2-database+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/h2-database/4e853fca-fab5-4955-b648-14083480ccc4n%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 h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/CAM4W5VZKX893zxMwR_K%2BtD_GPKh2RN5r--yw6%2BoMxSYZ_cqszg%40mail.gmail.com.


[h2] how much indexes are used for optimization

2024-04-05 Thread Rinse Lemstra

from the H2 website:

If a table has multiple indexes, *sometimes more than one index could be 
used.* Example: if there is a table TEST(ID, NAME, FIRSTNAME) and an index 
on each column, then two indexes could be used for the query SELECT * FROM 
TEST WHERE NAME='A' AND FIRSTNAME='B', the index on NAME or the index on 
FIRSTNAME. It is not possible to use both indexes at the same time.

In what conditions more then one index can be used?

regards,

Rinse

-- 
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 h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/4e853fca-fab5-4955-b648-14083480ccc4n%40googlegroups.com.