def create_index(transaction_executor, table_name, index_attribute):
    """
    Create an index for a particular table.
    :type transaction_executor: :py:class:`pyqldb.execution.executor.Executor`
    :param transaction_executor: An Executor object allowing for execution of statements within a transaction.
    :type table_name: str
    :param table_name: Name of the table to add indexes for.
    :type index_attribute: str
    :param index_attribute: Index to create on a single attribute.
    :rtype: int
    :return: The number of changes to the database.
    """
    print("Creating index on '{}'...".format(index_attribute))
    statement = 'CREATE INDEX on {} ({})'.format(table_name, index_attribute)
    # print(statement)
    cursor = transaction_executor.execute_statement(statement)
    return len(list(cursor))