Skip to content

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

Closed as not planned
Closed as not planned

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

  1. milindsrivastava1997 commented on Oct 27, 2026

    @milindsrivastava1997
    ContributorAuthor

    Superseded by the rqe-optimizer MILP path (#790, ProjectASAP/sketch-bench#129, #794); the greedy optimizer was removed in #807. The cost_model this refers to is gone; Subtract is out of scope in rqe-optimizer (ProjectASAP/sketch-bench#143).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions