问题
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