暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle 使用十亿个记录表中的行号获取数据的有效方法??

ASKTOM 2019-02-14
284

问题描述

我正在尝试使用行号approch从十亿个记录表中获取所需的数据
(即,从 (选择to_char(sys_extract_utc(systimestamp),'yyyy-MM-DD HH24:MI:SS.FF') 中选择 “ingest_ts_utc”,ROWNUM为来自XYZ.ABC的rno),其中rno介于361754731 381852215),

But its taking long time to get the data 和some times facing connection issues,

如何改进我的sql以有效地获取数据??


专家解答

如您提出的评论中所述:

扫描数亿行
然后
返回数千万个这样的

is going to take a while

要使此查询接近 “快速”,您需要读取并返回更少的数据。少得多。

要回答的问题,以便我们可以帮助您取得一些进展:

您是否真的从表中不选择任何列,只是systimetamp?如果是这样,why are you running this query at all
Why are you fetching 20 million+ rows? Do you really need that many?
Why are you using the rownum trick to get rows 361 million - 381 million? Why can't you a regular where clause against columns in the table?
文章转载自ASKTOM,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论