Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • Generally files are saved in chunks of 4096KB (OS-dependent however). If the file doesn't exceed this amount, it will never be stored on multiple chunks. More reading here. Commented Dec 20, 2018 at 14:22
  • @Neil I know, my point is lets say O.S stores files based on 4KB chunks, and may fragment some files when they exceed it, and the DBMS uses 16KB pages, my question is how do they implement that DBMS so that 16KB pages which get added to table files, dont get fragmented? when i append a 16KB data to a file, is it by default reserved for it and will never get fragmented? Commented Dec 20, 2018 at 14:36
  • 1
    @OneAndOnly, this question is off topic here because it is asking about a specific implementation rather than general engineering discipline. With that said, it's a good question, and now I am very curious to the answer! Commented Dec 20, 2018 at 14:43
  • 1
    @TheCatWhisperer but based on papers that I'm reading, all of the relational databases use these pages and dont get fragmented, and im not asking about a specific database or language, just any tips on how its done. paper : sciencedirect.com/science/article/pii/S1742287615000584 Commented Dec 20, 2018 at 14:44
  • 2
    Disk fragmentation is not user-visible, but abstracted away by the file system. Modern file systems defrag automatically in the background. Also, disk fragmentation primarily affects sequential access time on hard disks. That's not necessarily relevant for a database, especially not when using SSDs or RAID arrays. Speaking of which, SSDs often split up data internally for wear leveling. So the logical block device that the operating system sees usually has little relationship to the physical storage of the data. Commented Dec 21, 2018 at 21:23