Index not found error while using index hints

44 views
Skip to first unread message

sidhesh gawas

unread,
Feb 13, 2023, 7:41:57 AM2/13/23
to H2 Database
Hi,

I am facing issue while using index hints in my select query.
  
Select * from MY_TABLE USE INDEX(MY_TABLE_INDEX) 
When i fire a normal select query with out the hints works fine, but with the index hints it throws an error saying index not found.
nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Index \" MY_TABLE_INDEX  \" not found;

I have check the INFORMATION_SCHEMA.INDEXES on my table and the index is present.
Can someone please help me

Thanks,
Sidhesh

Evgenij Ryazanov

unread,
Feb 13, 2023, 9:27:26 AM2/13/23
to H2 Database
Hi!

I think there are only two possible reasons for that failure.
1. Index belongs to another table (possibly with the same name, but in different schema).
2. Index has another name, for example, "my_table_index" (quoted identifiers are case sensitive by default).
Reply all
Reply to author
Forward
0 new messages