Change get by key prefix method. Optimize it