Category Archives: Uncategorized

Sum of temp used from ASH view

I had a situation where I wanted to compare the temp space used by two similar insert statements on a test system.  One was filling up the temporary tablespace and the other wasn’t. select sql_id,sample_time, sum(TEMP_SPACE_ALLOCATED)/(1024*1024*1024) gig from DBA_HIST_ACTIVE_SESS_HISTORY where … Continue reading

Posted in Uncategorized | Leave a comment

ASH query for sequential reads

Quick post of a query I just used to diagnose a problem with a SQL statement that had a lot of db file sequential read waits.  This uses ASH data to see which segment the waits were on the most. … Continue reading

Posted in Uncategorized | Leave a comment

In enemy territory – OK really just SQL Server class

I spent the past four days in SQL Server 2012 performance tuning class with four of my coworkers.  It was so surreal walking into the Microsoft offices on the first day.  I kind of felt guilty after all these years … Continue reading

Posted in Uncategorized | Leave a comment

Cheese in January and the limits of SQL optimization

Prepping for my Intro to SQL tuning talk on Monday I did a little further research on one of my examples.  It is a concept I’ve known about for a while and I feel like it is profound evidence for … Continue reading

Posted in Uncategorized | 4 Comments

use_nl and use_hash hints for inner tables of joins

Spent several hours practicing my Introduction to SQL Tuning talk yesterday and it has made me think through the things I’m saying.  I don’t want to lead anyone astray by my talk, or the things I’ve posted on this blog.  … Continue reading

Posted in Uncategorized | 11 Comments

More than n! join orders?

Earlier today I was getting paranoid and thought I had found an error in my “Intro to SQL tuning” paper namely that there were more than n! join orders. Here is what I said in the paper: There are many … Continue reading

Posted in Uncategorized | Leave a comment

Faster commit time with shared servers

This is a follow up to my previous post “Faster commit time with fewer sessions“.  I’ve put together a test case against an HP-UX server running 10.2.0.3 of Oracle that shows commits six times faster with shared servers than with … Continue reading

Posted in Uncategorized | Leave a comment

Faster commit time with fewer sessions

I’m trying to understand how to prevent the database server that supports one of our web sites from becoming overwhelmed when the CPU %used gets too high.  Once CPU gets above about 80% performance takes a nose dive and CPU … Continue reading

Posted in Uncategorized | 3 Comments

Added plan_hash_value to DBA_HIST_SQLSTAT query

I modified my query of DBA_HIST_SQLSTAT that I use for query tuning to include plan_hash_value.  This is nice because you can see whether a particular plan corresponds to a longer run time.  Here a link the the modified script(updated). Here … Continue reading

Posted in Uncategorized | 1 Comment

optimizer_features_enable hint

I thought I had already posted on this, but I didn’t.  I recently used this hint to resolve an issue with a custom PeopleSoft Financials batch process running too long.  A particular query was taking over an hour instead of … Continue reading

Posted in Uncategorized | Leave a comment