pythia-impact

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Impact Before Change

修改前的影响分析

Announce at start: "Using pythia-impact to measure the blast radius first."
Changing an Oracle object recompiles or invalidates everything that depends on it — immediately, schema-wide, for every user of a shared database. The cost of knowing first is one command.
开始时告知: "使用pythia-impact先衡量影响范围。"
修改Oracle对象会重新编译或立即失效所有依赖它的对象——在整个模式范围内,影响共享数据库的所有用户。提前了解影响只需执行一条命令。

The Iron Law

铁则

NO CHANGE PROPOSED WITHOUT ITS IMPACT MEASURED FIRST
NO CHANGE PROPOSED WITHOUT ITS IMPACT MEASURED FIRST

The Workflow

工作流程

  1. pythia impact <OBJECT> --depth 2
    — everything that depends on it, as a tree, ending with the line that matters:
    -- impact: N dependent objects, M currently VALID
    .
  2. pythia deps <OBJECT> --depth 2
    — the other direction, what it uses; read it when the change touches calls or table access.
  3. pythia invalid
    — the baseline. Anything already INVALID before the change must not be blamed on the change later; apply compares against this automatically, but you should know the starting state too.
  1. pythia impact <OBJECT> --depth 2
    —— 查看所有依赖该对象的内容,以树形结构展示,最后一行是关键信息:
    -- impact: N dependent objects, M currently VALID
  2. pythia deps <OBJECT> --depth 2
    —— 反向查看该对象依赖的内容;当修改涉及调用或表访问时,需要查看此信息。
  3. pythia invalid
    —— 获取基准状态。修改前已经处于INVALID状态的对象,后续不能归咎于本次修改;apply操作会自动与此基准对比,但你也应该了解初始状态。

Reading the numbers

解读数值

ResultWhat to do
0 dependentsSay so and proceed; verify after apply anyway.
1–9 dependentsList them to the developer alongside the proposal.
10+ dependents, or any cross-schema dependentShow the tree and get an explicit go-ahead before writing any code.
Dependents already INVALIDPoint them out — the area is already unstable.
Tables deserve the same treatment as code:
impact
on a table shows every program that would be invalidated by an
ALTER
.
结果操作建议
0个依赖对象说明情况后继续执行;但修改后仍需验证。
1–9个依赖对象将依赖列表与修改方案一同告知开发人员。
10个及以上依赖对象,或存在跨模式依赖展示依赖树,并在编写任何代码前获得明确的批准。
依赖对象已处于INVALID状态指出这一点——该区域已不稳定。
表的处理方式与代码相同:对表执行
impact
命令可显示所有会因
ALTER
操作而失效的程序。

Red Flags — STOP if you catch yourself thinking

危险信号——若出现以下想法请立即停止

ThoughtReality
"It's just a small helper"Helpers are the most-depended-on objects there are.
"I'll check impact after writing the code"Then the number cannot change the design. Too late.
"The preview in apply shows impact anyway"That line is confirmation of a number you already knew — not discovery.
"It's a new object, nothing depends on it"True — say that, with
impact
output as evidence, not as an assumption.
想法实际情况
"这只是个小辅助工具"辅助工具是被依赖最多的对象。
"我写完代码再检查影响"此时数值已无法改变设计,为时已晚。
"apply操作的预览会显示影响"那行信息只是确认你已知晓的数值,而非发现新信息。
"这是新对象,没有任何依赖"确实如此——请用
impact
输出作为证据说明这一点,而非仅凭假设。

Hand-off

交接流程

Impact known and acceptable →
pythia-write
to write the change following the codebase's conventions →
pythia-apply
to land it with preview and verification.
确认影响可接受后 → 使用
pythia-write
按照代码库规范编写修改内容 → 使用
pythia-apply
执行修改并进行预览和验证。