in reply to Simple SQL like thingy?

I might be totally wrong...and it probably depends upon how you handle missing keys...if id and key_n form the compound unique index...then this might be useful (is in my case ;-)
{id} {key_1} = {value} {id} {""} = {value} {id} {key_2} = {value} {""} {key_1} = {value} {""} {key_2} = {value}