My table (user_tran) has 3 fields "user_id", "transaction_id", "time_stamp"
I hash index user_id and transaction_id (as I need to do the exact match) and b+ tree index on time_stamp
The query is
select user_id from user_tran where transaction_id = 1 and time_stamp > now() - 3 days;
select transaction_id from user_tran where user_id = 1 and time_stamp > now() - 3 days;
Does anyone know what is the complexity of this query? I know if we just filter by hash index column, it would be o(1) and b+ tree gives o(lgn). But what about combining them together?
Would that be o(lgn + 1)?
Also how would the table stored under the hood. Will the DBMS maintain 3 indexes (2 hash and 1 b+ tree) at the same time?
Googled around a little bit, but didn't find the answer.