Use HASH KEY instead of id for ids in indexes.

Fix issue #132.