)]}'
{
  "commit": "0ac434d0e5207b1e2d6fcc9c04b5a4de3b13bec8",
  "tree": "ebcbad024e872f3a3a7697bf784de990dfcb4493",
  "parents": [
    "02ce571910e6be643b29f6b282c86ab137dbfd2d"
  ],
  "author": {
    "name": "kosiew",
    "email": "kosiew@gmail.com",
    "time": "Sat Mar 07 12:10:15 2026 +0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Sat Mar 07 04:10:15 2026 +0000"
  },
  "message": "Add case-heavy LEFT JOIN benchmark and debug timing/logging for PushDownFilter hot paths (#20664)\n\n## Which issue does this PR close?\n\n* Part of #20002.\n\n## Rationale for this change\n\nThe `PushDownFilter` optimizer rule shows a severe planner-time\nperformance pathology in the `sql_planner_extended` benchmark, where\nprofiling indicates it dominates total planning CPU time and repeatedly\nrecomputes expression types.\n\nThis PR adds a deterministic, CASE-heavy LEFT JOIN benchmark to reliably\nreproduce the worst-case behavior and introduces lightweight debug-only\ntiming + counters inside `push_down_filter` to make it easier to\npinpoint expensive sub-sections (e.g. predicate simplification and join\npredicate inference) during profiling.\n\n## What changes are included in this PR?\n\n* **Benchmark: add a deterministic CASE-heavy LEFT JOIN workload**\n\n* Adds `build_case_heavy_left_join_query` and helpers to construct a\nCASE-nested predicate chain over a `LEFT JOIN`.\n* Adds a new benchmark `logical_plan_optimize_case_heavy_left_join` to\nstress planning/optimization time.\n* Adds an A/B benchmark group `push_down_filter_case_heavy_left_join_ab`\nthat sweeps predicate counts and CASE depth, comparing:\n\n    * default optimizer with `push_down_filter` enabled\n    * optimizer with `push_down_filter` removed\n\n* **Optimizer instrumentation (debug-only)**\n\n* Adds a small `with_debug_timing` helper gated by `log_enabled!(Debug)`\nto record microsecond timings for specific sections.\n  * Instruments and logs:\n\n    * time spent in `infer_join_predicates`\n    * time spent in `simplify_predicates`\n* counts of parent predicates, `on_filters`, inferred join predicates\n    * before/after predicate counts for simplification\n\n## Are these changes tested?\n\n* No new unit/integration tests were added because this PR is focused on\n**benchmarking and debug-only instrumentation** rather than changing\noptimizer semantics.\n* Coverage is provided by:\n\n  * compiling/running the `sql_planner_extended` benchmark\n* validating both benchmark variants (with/without `push_down_filter`)\nproduce optimized plans without errors\n* enabling `RUST_LOG\u003ddebug` to confirm timing sections and counters emit\nas expected\n\n## Are there any user-facing changes?\n\n* No user-facing behavior changes.\n* The optimizer logic is unchanged; only **debug logging** is added\n(emits only when `RUST_LOG` enables Debug for the relevant modules).\n* Benchmark suite additions only affect developers running benches.\n\n## LLM-generated code disclosure\n\nThis PR includes LLM-generated code and comments. All LLM-generated\ncontent has been manually reviewed and tested.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "adaf3e5911e9b6680b3ec46415888ba1ffcb3c3a",
      "old_mode": 33188,
      "old_path": "datafusion/core/benches/sql_planner_extended.rs",
      "new_id": "d4955313c79c305784fe33e006f0f491d275b069",
      "new_mode": 33188,
      "new_path": "datafusion/core/benches/sql_planner_extended.rs"
    },
    {
      "type": "modify",
      "old_id": "f1664f267b298908dd3c6735fac078567865150d",
      "old_mode": 33188,
      "old_path": "datafusion/optimizer/src/push_down_filter.rs",
      "new_id": "03a7a0b86417746c017a32c260aee7ca7852dd58",
      "new_mode": 33188,
      "new_path": "datafusion/optimizer/src/push_down_filter.rs"
    }
  ]
}
