I would like to help Oracle's query optimizer make better-informed decisions. I have been unable to find much information on how the optimizer determines the cost of I/O operations, other than unsourced remarks that it uses the time that it takes to retrieve a single data block. Here are some things that I would like to know:
Is it possible to view the current I/O benchmarks used by the optimizer?
Is it possible to trigger an update of those benchmarks?
Does the optimizer account for the current I/O cost of an operation? For example, if there is heavy concurrent load on the storage device causing a reduction in performance, does it consider that the relative cost of I/O will temporarily be higher?
Does the optimizer consider latency/random-access performance versus throughput/sequential performance?
If you have data files on multiple storage devices with different performance characteristics, does the optimizer have and apply device-specific costs?
-
(5) seems to imply that you have a bad physical design. All the disks in your disk group [ASM]/RAID set should have the same performance characteristics.Michael Kutz– Michael Kutz2018年05月10日 17:20:22 +00:00Commented May 10, 2018 at 17:20
-
For (5), I didn't say that the devices were in the same RAID set. I am talking more of employing tablespaces with different performance characteristics for different intended usage patterns. For example, one could use cheap, slow storage for infrequently-accessed readonly data, low-latency storage for objects subjected to a lot of random access, etc.novog– novog2018年05月10日 17:36:37 +00:00Commented May 10, 2018 at 17:36
2 Answers 2
- You can see currently used statistics in
SYS.AUX_STATS$
. DBMS_STATS.GATHER_SYSTEM_STATS
collects system statistics. Running it withgathering_mode='NOWORKLOAD'
will capture IO related stats of the server. You usually also run it under workload ("START/STOP", "INTERVAL").- (4,5) Collecting system statistics during typical load should take care of potential problems you mentioned.
In addition , (4) will be affected by optimizer mode (
ALL_ROWS
vsFIRST_ROWS
)
Also, with procedures in dbms_stats
packages it's possible to collect stats multiple times, export (EXPORT_SYSTEM_STATS
), import (EXPORT_SYSTEM_STATS
), or delete it (DELETE_SYSTEM_STATS
).
I don't have any real answers. I mainly have pointers for where you can go to look for more information.
Viewing I/O Statistics (1)
You might enjoy this URL:
It appears that Oracle keeps "round trip" information within V$FILESTAT.
Updating I/O Statistics (2)
Oracle ORION was the first thing that came to my mind. After a quick search, it appears that there is a DBMS Package to update I/O statistics.
https://oracle-base.com/articles/misc/measuring-storage-performance-for-oracle-systems
Question 3 and 4
I only have my own thoughts and reasoning.
SAS vs SATA (5)
The concept of "different characteristics" is not foreign to the Oracle Database (at least, not within the documentation). 12c's ILM
clause allows you to automatically move data from a tablespace on ASM diskgroup [+SAS]
to a tablespace on ASM diskgroup [+SATA]
.
However, I would not mix files with different characteristics within the same tablespace.
Inner/Outer Sections of a Disk Platter
ASM seems to have the ability to distinguish these. I would look through the documentation.
https://docs.oracle.com/database/121/OSTMG/GUID-857680CA-35B0-4C88-9DF4-55537C8F1B7C.htm#OSTMG13790