def used_indexes(query, using=DEFAULT_DB_ALIAS):
connection = connections[using]<EOL>with connection.cursor() as cursor:<EOL><INDENT>cursor.execute("<STR_LIT>" + query)<EOL>return {row['<STR_LIT:key>'] for row in fetchall_dicts(cursor)<EOL>if row['<STR_LIT:key>'] is not None}<EOL><DEDENT>
Given SQL 'query', run EXPLAIN and return the names of the indexes used