I have a SELECT Query, which joins three tables.
I have created indexes on the PKs and FKs of all the tables.
I made sure the indexes are created by using SHOW COLUMNS command.
As the query took longer than expected, I used EXPLAIN command with the SELECT query to see which indexes CRDB is using, I saw non.
Q1. Can CRDB find and use the indexes by itself or should I tell the query planner which index to use by myself?
I told the query planner which indexes to use by using @ after name of the tables and surprisingly the execution time increased almost 4 times of the original query without telling the query planner which indexes to use.
Q2. Any idea why that happened?