morrySnow opened a new pull request, #67797:
URL: https://github.com/apache/doris/pull/67797

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: None
   
   Problem Summary: Nereids created ProcessState and maintained rewrite-path 
state even when plan-process tracing was disabled, rendered the final physical 
plan for every SQL-cache candidate before cache admission, and repeated cost 
calculations and weighted-cost object construction in the Cascades hot path.
   
   This PR:
   
   - Creates ProcessState only while plan-process tracing is active. EXPLAIN 
PLAN PROCESS remains unchanged.
   - Defers SQL-cache physical-plan rendering until FE or BE cache-admission 
checks succeed.
   - Removes redundant pre-regulation node-cost calculation and child-cost 
accumulation, while retaining the final property-aware cost recalculation.
   - Replaces CostWeight allocation with direct immutable Cost addition while 
preserving non-negative-weight validation.
   
   The independently measured ProcessState and cost-cleanup budgets are:
   
   | Query | CPU saving | Planning latency saving | Allocation saving |
   |---|---:|---:|---:|
   | TPCH Q5 | 0.303 ms / 2.7% | 0.552 ms / 4.5% | 200.1 KiB / 4.6% |
   | TPCDS Q72 | 0.335 ms / 2.0% | 0.490 ms / 3.0% | 526.3 KiB / 5.4% |
   | TPCDS Q64 forced Cascades | 1.712 ms / 5.1% | 2.027 ms / 5.7% | 2618.5 KiB 
/ 9.7% |
   
   These are arithmetic budgets from independently measured constituents, not a 
combined-patch ABBA result. Deferred SQL-plan rendering exposes an additional 
CPU/allocation cost pool of 0.408 ms/242.8 KiB, 0.588 ms/459.8 KiB, and 1.348 
ms/1012.5 KiB respectively. Realized total CPU savings for that part scale with 
the non-admission ratio.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test: Unit Test
       - RewriteTopDownJobTest, CostModelV1Test, 
ChildrenPropertiesRegulatorTest, and SqlCacheTest: 14 tests passed
       - Final CostModelV1Test and ChildrenPropertiesRegulatorTest rerun: 11 
tests passed
       - Full FE Maven build: 81/81 modules passed
       - FE Checkstyle: 0 violations
       - Generated sources completed successfully
   - Behavior changed: No
   - Does this need documentation: No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to