Skip to content

Optimizer cost model: Subtract cost assumes T = W #765

Description

@milindsrivastava1997

Problem

cost_model::query_cost prices Subtract as O(1) (merge + subtract + query). That holds only when the repeat interval T equals the window W (design doc open item 6). When T > W, each query must fold in ⌊T/W⌋ newly completed windows and subtract as many evicted ones, so cost scales with T/W.

Once items keep their own T (instead of the gcd), T > W becomes common and Subtract is systematically underpriced.

Change

Price Subtract as a function of T/W, or restrict Subtract candidates to T = W.

Part of #753.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions