def get_unknown_entity_log_number(schema_editor):
    """ Get the number of the log records that correspond to unknown entities """
    with schema_editor.connection.cursor() as cursor:
        cursor.execute(
            """
            SELECT COUNT(*) FROM db_dblog
            WHERE
                (db_dblog.objname NOT LIKE 'node.%') AND
                (db_dblog.objname NOT LIKE 'aiida.workflows.user.%')
            """
            )
        return cursor.fetchall()[0][0]
