first_rows , first_rows(10), all_rows 解释

本文介绍了Oracle数据库中FIRST_ROWS和ALL_ROWS两种查询方式的区别。FIRST_ROWS适用于需要快速响应的应用场景,可以迅速返回部分结果;而ALL_ROWS则追求最大的查询吞吐量,一次性返回所有结果。根据业务需求选择合适的查询方式可以显著提升系统的性能。

1.FIRST_ROWS 是第一时间把选择到的纪录 (比如先找到符合要求的第一条数据),立即把
这个部分结果集返回给请求。 同时oracle 还在继续寻找其他符合条件的纪录, 主要目的
是追求一个快速响应时间(部分记录响应快)。


2.FIRST_ROWS(n),第一时间返回前n条纪录,(n 必须是,1,10,100,1000,....)具体同1。


3.ALL_ROWS 是oracle综合考虑把所有结果记录集通过最快的路径找到,后然后把所有
结果集一次返回给请求。追求的是最大吞吐量。

1,3 的比较是1返回结果的反应快,但是所有结果都返回的时间一般超过3需要的时间。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-759944/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/35489/viewspace-759944/

@staticmethod def _row_order_match_handle(base_rows, target_rows, is_col, head_indexes=None): """ 按照行顺序匹配的处理逻辑 """ _ = head_indexes def is_value(row_obj): # 判断是否有单元格包含文本 return any(cell.text for cell in row_obj.cells) if not is_col and base_rows and base_rows[0].cells: first_cell = base_rows[0].cells[0] # 处理特殊格式的顺序匹配 if first_cell and first_cell.text == 'Ver.' and len(base_rows) == len(target_rows) == 2: return list(zip(base_rows[:len(base_rows)], target_rows[:len(base_rows)])) if first_cell and first_cell.text == 'メータDB用エリア' and len(base_rows) == len(target_rows): return list(zip(base_rows[:len(base_rows)], target_rows[:len(base_rows)])) # 整个sheet页需要定制化匹配 block = first_cell while not is_instance_of(block, DocumentBlockObject) and block and hasattr(block, 'layout'): block = block.layout.parent_ref # 判断是否是需要顺序匹配的sheet页 if block and block.name in ( '521_燃料残量警告', '3203_エンディング表示', '2. テルテール一覧', 'TT', '1. 機能一覧', 'バリエーション機能マトリックス作成', '車両設定(2)','PN introduced country list'): head_content = ','.join([item.text for item in base_rows[0].cells]) if '項目名' in head_content: result = list(zip(base_rows[:7], target_rows[:7])) result.extend([(base_rows[7], target_rows[8]), (base_rows[9], target_rows[10])]) return result row_num = min(len(base_rows), len(target_rows)) # 使用列表推导式简化匹配逻辑 return [ (base_rows[base_index], target_rows[after_index]) for base_index, after_index in zip(range(row_num), range(row_num)) if is_value(base_rows[base_index]) and is_value(target_rows[after_index])] return []
最新发布
11-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值