Has nothing to do with memory at all (that's orthogonal). For example: - You have an index on a `cre
Has nothing to do with memory at all (that's orthogonal). For example:
- You have an index on a
- You query
- Without the index, it'd be effectively a full table sort / scan - e.g. a 500,000 row table is going to read 500,000 rows in that case.
- With the index, depending on your query, you could read as few as two rows (one index lookup, one row from the
- You have an index on a
created_at column of a users table- You query
SELECT * FROM users WHERE created_at = ?1 - that will use the index to look up the rows in the users table. This means there is a read on the index, and then a (MUCH SMALLER) read on the users table as you no longer have to do a full scan for the row(s) matching your created_at filter.- Without the index, it'd be effectively a full table sort / scan - e.g. a 500,000 row table is going to read 500,000 rows in that case.
- With the index, depending on your query, you could read as few as two rows (one index lookup, one row from the
users table, if your query only matches one row)




