I wanted to understand where an app was spending time. I couldn’t get the granularity I needed from New Relic, and SSMS aggregated the data so I couldn’t see it. I came up with what is below, admittedly, somewhat obtuse,…
Category: Oracle
Child records where no parent exists?
This is a great interview question: How can there be child records where no parent exists? This is actually a trick question. There can exist child *records*, but no *values* for the column that references a non-existent parent. In other…
Oracle materialized view and query rewrite
Just a simple example to show what it takes to get this to work… SQL> set lines 1000 trims on pages 100 SQL> explain plan for select count(*) from member; Explained. SQL> select * from table(dbms_xplan.display()); PLAN_TABLE_OUTPUT ——————————————————————————– Plan hash…
Calculating waits for a session for a given time window
We used this to quickly determine where a specific session was spending its time. This simply creates associative arrays for events, the time waited, and the total number of waits for that event, all at a specific point in time.…