How does the Database decides which Index to execute
===

DDL
---


    create table t
    (
    	id int,
    	id1 int
    )
    
    create index Example_Index
      On t(id,id1)
    
    create index Example1_Index
      On t(id1,id)

---

DML
---


    insert into t(id, id1)values(1, 100)
    insert into t(id, id1)values(1, 101)
    insert into t(id, id1)values(2, 103)
    insert into t(id, id1)values(1, 104)
    insert into t(id, id1)values(3, 105)
    insert into t(id, id1)values(1, 106)
    insert into t(id, id1)values(2, 107)
    insert into t(id, id1)values(3, 108)

---



Query - `select * from t Where id = 107`  -- Fires `Example_Index`

Query - `select * from t Where id1 = 107` -- Fires `Example1_Index`

Query - `select * from t`                 -- Fires `Example1_Index`


**Confusion** - How does the system decides to execute `Example1_Index`