Hit some bad performance hotspots at work yesterday with the new suffix stuff.

The main problem occurs when you do text searches with multiple words, some of which are very popular. The query optimiser frequently makes a bad decision, which boils down to not being able to compute the permutations of the popular word, as it crosses 2 joins (suffixes->suffixlinks->triples) before exploding. The biggest problem case was the word 'drkw' (i.e. the name of the company), which occurs in few suffixes (resulting in a good match on the index), but translates to many thousands of literals when linked through to the triplestore. E.g. In a search for 'drkw dam', the optimiser favours using 'drkw' first, since it has fewer suffix index matches, whereas a search for dam would return just a few hundred eventual literals.

Claire's gone to see a friend for a couple of hours, so have got some time to play with this...