(db)
Add an index to the 'identifier' column to make queries faster.
Add an index to the 'identifier' column to make queries faster.
Add an index to the identifier column to make queries faster .
def _add_temp_index(db):
    """Add an index to the 'identifier' column to make queries faster."""
    add_identifier_index = """
        CREATE INDEX CONCURRENTLY {identifier_index_name} ON {case_index_table} (identifier)
    """.format(
        case_index_table=CommCareCaseIndexSQL._meta.db_table,
        identifier_index_name=IDENTIFIER_INDEX_NAME
    )
    with CommCareCaseIndexSQL.get_cursor_for_partition_db(db) as cursor:
        if not _index_exists(db, IDENTIFIER_INDEX_NAME):
            log_sql(add_identifier_index)
            cursor.execute(add_identifier_index)
def _add_temp_index ( db ) : add_identifier_index = """
        CREATE INDEX CONCURRENTLY {identifier_index_name} ON {case_index_table} (identifier)
    """ . format ( case_index_table = CommCareCaseIndexSQL . _meta . db_table , identifier_index_name = IDENTIFIER_INDEX_NAME ) with CommCareCaseIndexSQL . get_cursor_for_partition_db ( db ) as cursor : if not _index_exists ( db , IDENTIFIER_INDEX_NAME ) : log_sql ( add_identifier_index ) cursor . execute ( add_identifier_index )