Hacking Session by Tanel Põder I'll upload the video of this session to YouTube: tanelpoder.com/videos Subscribe to weekly updates: tanelpoder.com/contact Mark your calendars: Oracle Hinting Hacking Session on Tuesday 2. June!
Repo • Open Source (Apache 2.0 license) • Pull & diff updates • https://github.com/tanelpoder/tpt-oracle • https://github.com/tanelpoder/tpt-oracle/archive/master.zip Where to get my scripts? $ cd /Users/tanel/work/oracle/tpt $ find . -type f -name "*.sql" | wc -l 1049 No, I don't remember what all of them do J But there's a @help.sql now!
of Oracle SQL Monitor • by Maria Colgan • https://sqlmaria.com/2017/08/01/getting-the-most-out-of-oracle-sql-monitor/ • Previous SQL Monitoring Hacking Sessions • By me • https://tanelpoder.com/videos/ • Execution plans • by Jonathan Lewis • https://jonathanlewis.wordpress.com/2020/05/05/execution-plans-5/ • Virtual Conference (28-29 September 2020) • https://tanelpoder.com/conference Useful material (that I won't cover here much)
data processing, not retrieval • Hash joins and a GROUP BY spilling to TEMP SQL Monitoring: A query bottlenecked by data processing, not retrieval Most time spent on data processing
Duration?! Duration = 15 seconds (wall-clock time) DB Time = 1.3 seconds (time spent inside DB) 332 000 rows were returned, fetched 10 rows at a time (33167 fetches). Most time spent on network roundtrips outside DB
Duration? Duration = 9 seconds (wall-clock time) DB Time = ~36 seconds (time spent inside DB) Parallel Execution! Each slave can use up to 1 second of DB Time per wall-clock second (plus QC)
DB execution (on CPU) OS syscall execution (on CPU) Disk queueing and service (off CPU) begin OWI wait T0= gettimeofday() end OWI wait T1= gettimeofday() IO queueing time IO service time CPU queuing time CPU service time CPU service time -> kcbgtcr() -> ksdfdread() -> skgfqio() Begin Wait End Wait wait event duration The CPU scheduling latency (CPU wait) may inflate wait event duration as Oracle sees it – during CPU starvation New scripts for estimating CPU scheduling latency: @schedlat.sql – Oracle 12c+ tools/unix/runqlat.sh - Linux https://tanelpoder.com/posts/schedlat-low-tech-script-for-measuring-cpu-scheduling-latency-on-linux/