It looks like you are using an index on a CLOB column. Most databases
don't allow you to add an index on a CLOB or BLOB, but H2 allows it.
However, there is a problem when opening the database when trying to
re-apply committed transactions, because the CLOB/BLOB mechanism now
requires an open database.... So the index can't be updated.
I'm not sure what the best solution is. Maybe H2 shouldn't allow you
to create an index on a BLOB or CLOB column, like most other
databases.
Regards,
Thomas
That is definately the way to go until someone provides a solution that
actually works.
I would assume the no one wants to index BLOBs and for CLOBs you most
likely want to use a fulltext index.
I am assuming that a regular index or fulltext index does not speed up
regex or like queries?
Currently the fulltext index is created for the whole database and there
can be only one index / database.
Maybe in the future the fulltext index could be made as just one of the
possible index types for character based columns?
And then the idea of having indexes on CLOBs could be revisited.
- rami
The next version of H2 will not allow to create indexes on BLOB and
CLOB columns.
> I am assuming that a regular index or fulltext index does not speed up regex
> or like queries?
Currently not. A regular index can in theory speed up queries of the
form "column like 'xxx%'", but in practice such indexes are still bad
because they load a lot of data (log(n) rows, but each row can be very
big).
> Currently the fulltext index is created for the whole database and there can
> be only one index / database.
You can define what tables / columns to index:
http://h2database.com/javadoc/org/h2/fulltext/FullText.html#createIndex_Connection_String_String_String
But it's true that there is only one fulltext index per database.
> Maybe in the future the fulltext index could be made as just one of the
> possible index types for character based columns?
Yes, that would be an option.
Regards,
Thomas