I'm trying to wrap my head around the difference between various kinds of database indexes. I have created a little example for myself and I don't know whether I'm understanding everything correctly.
Let's say we have an fictional database table like this:
addr col1 col2
===============
1 a b
2 c b
3 a c
4 d d
5 c a
6 a b
7 c b
8 d d
9 a c
addr
here is a physical location of the corresponding tuple. Here is my understanding of how a single-column, a multi-column and a covering index would look like (not physically, rather on a conceptual level):
create index on col1
a - 1, 3, 6, 9
c - 2, 5, 7
d - 4, 8
create index on (col1, col2)
a b - 1, 6
a c - 3, 9
c a - 5
c b - 2, 7
d d - 4, 8
create index on col1 include col2
a - 1b, 3c, 6b, 9c
c - 2b, 5a, 7b
d - 4d, 8d
So my question is: do I get it right?