More complex vfolder queries.

In the original database design (0.4.7 and before) I had the following query:

Example 5. Old gmail glx list query:

(headers LIKE "%glx-dev%" AND direction = "Incoming") 

On a testbed of around 12,000 messages, this took around 5 seconds.

After the database redesign of 0.4.8 the same vfolder query takes 1.5 seconds!. This is quite satisfactory performance.

But if you try and limit the search fields to something in the 'display' table (which is very fast because it is fixed length), for example:

Example 6. Fast gmail glx list query:

(subject LIKE "%[glx-dev]%" AND direction = "Incoming") 

Because this mailing list puts the term '[glx-dev]' in the subject line, we can limit our search to only the 'display' table and the query only takes 0.16 seconds!!!! This is the performence we are aiming for (this is on a database of around 12000 messages).

This is not the most common case, as mailing list usually do not put a special text in the header, if they do though, you should search on that.

Of course, this information is about speeding up the uncached query time. If you are using caching you will achieve the sub 1 second query time consistently!