1 ) A method for optimizing an index hashing function comprising: a) designing a programmable index hashing function; b) running an application several times on a CPU containing said programmable index hashing function; c) calculating an optimal hashing function based on actual performance of said application in cache memory of said CPU. d) programming said programmable index hashing function to approximate the optimal hashing function calculated in step c.