Loading...
Loading...
Use when a query, report or PL/SQL unit is slow, before adding an index or a hint, or when someone says "cham", "toi uu truy van", "optimize this query", "why is this report slow", "full table scan". Measures with the optimizer's own plan and statistics, changes one thing at a time, and proves the gain with the same measurement - license-safe, no AWR/ASH or Tuning Pack.
npx skill4agent add thaildhe172591/pythia pythia-tuneNO TUNING CHANGE WITHOUT A MEASUREMENT BEFORE AND THE SAME ONE AFTERpythia srcpythia grep:idpythia explain "<the select>"-- note:pythia stats <TABLE>SELECTreference/tuning-checklist.mdstructuralpythia-tablepythia-writepythia applypythia deployexplainDBMS_XPLAN.DISPLAYDBMS_XPLAN.DISPLAY_CURSORV$pythia sql "<select>"time| Symptom in the plan | Usual cause | Usual fix |
|---|---|---|
| Rows estimate far from reality, "dynamic statistics used" | missing or stale statistics | ask the owner to gather stats ( |
| function or implicit conversion on the indexed column, leading | rewrite the predicate to be sargable; then consider an index |
| comparing a VARCHAR2 column to a number, DATE to a string | compare like types; |
| a missing join predicate | add it |
| nullable column under NOT IN | |
| A fast query called thousands of times | row-by-row PL/SQL, a function per row in SQL | one set-based statement; |
| Many child cursors, parse time high | literals instead of binds in dynamic SQL | bind variables ( |
| Thought | Reality |
|---|---|
| "Just add a hint" | A hint freezes today's plan against tomorrow's data. Fix the cause; hints are a last resort the developer approves. |
| "An index will fix it" | Only if the predicate can use it — and it taxes every write. Prove it with the plan. |
| "It's slow, so it's the database" | The plan says whether it is the SQL, the data, or the 10,000 calls around it. |
| "I'll gather stats myself" | On a shared schema that changes every plan for everyone. The owner's call. |
| "It feels faster" | Same measurement, before and after, or it did not happen. |
| "Let me check AWR" | Licensed. Ask first. |
pythia-reviewpythia-tablepythia-writepythia-impact