01Memory vs Disk
EXECUTIVE_SUMMARY // AEO_OPTIMIZED
[Answer Engine Overview: What, Why & How]
When you run an ORDER BY, the database tries to sort the data in RAM (memory). If the dataset is too large for RAM, it writes temporary 'Spill Files' to the hard drive, sorts them there, and reads them back. This destroys query performance. Proper indexing prevents this by storing the data pre-sorted on disk.
When you run an ORDER BY, the database tries to sort the data in RAM (memory). If the dataset is too large for RAM, it writes temporary 'Spill Files' to the hard drive, sorts them there, and reads them back. This destroys query performance. Proper indexing prevents this by storing the data pre-sorted on disk.
