def namedb_get_num_blockstack_ops_at( db, block_id ):
    """
    Get the number of name/namespace/token operations that occurred at a particular block.
    """
    cur = db.cursor()

    # preorders at this block
    preorder_count_rows_query = "SELECT COUNT(*) FROM preorders WHERE block_number = ?;"
    preorder_count_rows_args = (block_id,)
    
    num_preorders = namedb_select_count_rows(cur, preorder_count_rows_query, preorder_count_rows_args)

    # committed operations at this block
    query = "SELECT COUNT(*) FROM history WHERE block_id = ?;"
    args = (block_id,)

    rows_result = namedb_query_execute(cur, query, args)

    count = 0
    for r in rows_result:
        count = r['COUNT(*)']
        break

    log.debug("{} preorders; {} history rows at {}".format(num_preorders, count, block_id))
    return count + num_preorders
Get the number of name/namespace/token operations that occurred at a particular block.