Improves the speed of data retrieval operations on a smdb database.

The commit improves performance using data index based on
lookup tables.