Properly quote table names and attribute values in attribute and cache index SQL queries