On Wed, 3 Oct 2007 15:39:06 +0200, you wrote: > > > >I created an index on a TEXT column as I want to be able to >I noticed a large increase in the file size. >Looking at the binary of the file, I see that the index has a copy of all the >data being indexed. >1. Is this necassary? >2. Is there a way to keep the index only in memory and not in the file. > >Clive
A long time ago I saw index systems (don't remember, perhaps a mainframe with indexed sequential files), where the B-Tree used simple 'key compression'. Some encoding scheme which replaces the key field by a structure (repeat_length, keypart). Best shown in an example (my keys are 'frank', 'franklin', 'fred', 'google', 'gopher'): - store the full key 'frank' of the first entry in the page as (0,frank) - store 'franklin' as (5,lin), meaning: take the first five characters of the previous key and concatenate the rest. - store 'fred' as (2,ed) - store 'google' as (0,google) - store 'gopher' as (2,pher) This works nicely for large indexes with long keys and a lot of repetition. Of course the effort to handle insertions and deletions is significant. -- ( Kees Nuyt ) c[_] ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------