fixing some performance issues and moving keyword and sid out of hstore