3 ms·
An index stores pointers to rows based on the column value; the values are still stored as rows though. So when you query on an indexed column, you'll have con
by setr 9y ago
An index stores pointers to rows based on the column value; the values are still stored as rows though.
So when you query on an indexed column, you'll have contiguous access on the index, but the rows themselves may be stored on disk based on a different column (so you'll could get the row pointers for a range query in one go from the index but fetching the rows would be random lookups). But if you want to view an entire row, its trivial, because the full row data is contiguous on disk.
Column store groups the table values by the column, so the values of col A will be contigous, and col B will be contiguous, (but not pairwise!) but if you want to view the entire row, you'll probably have to do 2 lookups in random locations. But the range query on col A, selecting only col A, becomes a trivial fetch.
Thats my understanding anyways