The Gmail email client, Page 2
SQL Made Easy
(subject LIKE "%Snort%" AND direction = "Incoming")
((subject LIKE "%Gmail%" OR tofield LIKE "%gmail-discuss%") AND direction = "Incoming")
"Gmail uses two tables to store emails. Why two? Because one is fixed length for fast access, and the other contains data which is variable in length.
"The fixed length table is called 'display', the vfolder usable fields are: date, subject, fromfield, readstatus (Read, Unread, Sent or Queued), direction (Incoming or Outgoing).
"The other table is called 'details', the vfolder usable fields are: headers (all the headers from the email), message (the body of the email), tofield, ccfield, bccfield, attachments (not in use yet)."
For each message in the database, Gmail "caches" its "folder matches," i.e. a list of all the queries that message matches, for speedy navigation among different vfolders. Whenever a vfolder query is added, deleted or modified, this matching index must be rebuilt, but Gmail automatically prompts the user whenever this step is necessary. This is the one Gmail operation that can be time-consuming, depending on the speed of the machine and the size of the message base. On the author's test machine, an old K6-233, a database of 4450 messages with ten vfolders required two minutes fifty four seconds for this step.
Although Gmail's performance does not slow down as the size of the message base increases (with the one exception just noted), eventually it may be desirable to archive the messages one has accumulated. The mbox export is perfect in this context; after accumulating, say, six months of the dozen or so Debian (substitute your favorite distro) lists one subscribes to, those six months worth of messages can be read out into one mbox file for long term storage. There's no need to keep track of twelve archives, one for each list.
Page 2 of 3