Database Internals, B-tree Implementation, WAL Mode, Query Optimization