Read each row once while multiple processes insert into the same Oracle table?

孤者浪人 提交于 2019-12-12 04:55:43

问题


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.

My questions are:

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

  • Could there be more than one process reading data from the table at the same time?


回答1:


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.

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.



来源:https://stackoverflow.com/questions/27955185/read-each-row-once-while-multiple-processes-insert-into-the-same-oracle-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!