I've been working with databases for the last few years and I'd like to think that I've gotten fairly competent with using them. However I was reading recently about Joel's Law of Leaky Abstractions and I realised that even though I can write a query to get pretty much anything I want out of a database, I have no idea how the database actually interprets the query. Does anyone know of any good articles or books that explain how databases work internally?
Some specific things I'm interested in are:
- What does a database actually do to find out what matches a select statement?
- How does a database interpret a join differently to a query with several "where key1 = key2" statements?
- How does the database store all its memory?
- How are indexes stored?