读取每行一次,同时多个进程插入到同一个Oracle表中? [英] Read each row once while multiple processes insert into the same Oracle table?

查看:267
本文介绍了读取每行一次,同时多个进程插入到同一个Oracle表中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表,多个进程在一天内非常迅速地插入数据。假设至少有一个进程在任何给定时刻执行插入操作。

I have a table into which multiple processes insert data very rapidly throughout the day. Assume that at least one process is performing an insert at any given moment.

我需要在白天从此表读取,而插入操作正在进行。我需要读取每一行,但我只需要读取每一行一次。

I need to read from this table during the day, while the inserts are happening. I need to read every row but I only need to read each row once.

我的问题是:


  • 单个进程是否可以这样从表中读取而不影响插入性能?

  • Is it possible for a single process to read from the table this way without affecting insert performance?

推荐答案

Oracle实现多版本读一致性,因此读者不会阻塞写者(读者也不会阻止其他读者)。

Oracle implements multi-version read consistency so readers don't block writers (nor do readers block other readers). You can have as many processes reading data as you'd like without affecting insert performance.

当然,在现实中,你的硬件和你的应用程序可能会施加某种约束关于这个理论。例如,如果你的系统是CPU限制的,并且你介绍这么多的读者,大部分的CPU被给予读者,牺牲了写者,你可能会遇到一些性能问题。如果你正在读取的行足够长,在他们被插入,他们已经过缓冲区缓存(和文件系统缓存,如果这是在播放)之后,读者将添加I / O到系统,如果你的系统是I / O绑定。

Of course, in reality, your hardware and your application probably imposes some sort of constraint on this theory. If your system is CPU bound, for example, and you introduce so many readers that a significant fraction of the CPU is being given to the readers at the expense of the writers, you'll likely encounter some performance issues. If you are reading rows long enough after they have been inserted that they've been aged out of the buffer cache (and the file system cache if that's in play), readers will add I/O to the system which may impact performance if your system is I/O bound.

这篇关于读取每行一次,同时多个进程插入到同一个Oracle表中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆