|
|
|
|
|
by branko_d
618 days ago
|
|
From the article: Having the data aligned ensures faster access time when retrieving pages from disk.
Byte-level alignment cannot possibly have anything to do with retrieving pages from disk, simply because the unit of retrieval is the whole page. From the hardware/OS perspective, a page is just an opaque blob of bytes (comprised from one or more blocks on the physical drive).Only after these bytes have reached RAM does the byte-level alignment play a role, because CPU works slower on misaligned data. The article itself then goes on to illustrates the above (and seemingly contradict itself): SQLite does not pad or align columns within a row. Everything is tightly packed together using minimal space. Two consequences of this design:
SQLite has to work harder (use more CPU cycles) to access data within a row once it has that row in memory.
SQLite uses fewer bytes on disk, less memory, and spends less time moving content around because there are fewer bytes to move.
|
|