Why are the emails from Apple Mail in this numbered directory structure

emailfoldersmail.app

I was looking into my users' Library/Mail folder at some emails and was wondering why they are organised the way they are. In ~/Library/Mail/V3/Mailboxes/Friends.mbox/5EF13EFE-AB95-43A9-93BB-E01CAE8DA511/Data/ there are a number of directories numbered 0 to 9. In each of these I have a number of further numbered directories, e.g. in folder 0 there are 3, 4 and 5. Each of these has a Message folder, which in turn has the individual emails.

Is there are reason why these are not all in the same directory under the Friends.mbox directory? Is that for indexing reasons?
What is the hashed directory (5EF13EFE-AB95-43A9-93BB-E01CAE8DA511) for?

I'm using El Capitan.

Best Answer

It looks like an Universally Unique Identifier (UUID) is a 128-bit number used to identify information in computer systems.

Anyone can create a UUID and use it to identify something with near certainty that the identifier does not duplicate one that has already been created to identify something else, and will not be duplicated in the future. Information labeled with UUIDs by independent parties can therefore be later combined into a single database, or transmitted on the same channel, without needing to resolve conflicts between identifiers.

In its canonical string representation, the sixteen octets of a UUID are represented as 32 lowercase hexadecimal (base 16) digits, displayed in five groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters and four hyphens). For example:

123e4567-e89b-12d3-a456-426655440000