Skip to content

A crowded low-cardinality dimension no longer pushes the true grain out of the composite-key probe - #237

Merged
marcociav-exmergo merged 3 commits into
mainfrom
SCRUM-1022-issue-168
Aug 7, 2026
Merged

A crowded low-cardinality dimension no longer pushes the true grain out of the composite-key probe#237
marcociav-exmergo merged 3 commits into
mainfrom
SCRUM-1022-issue-168

Conversation

@emnarahmouni-exmergo

Copy link
Copy Markdown
Contributor

Closes : #168

_probe_composite_keys (explore/profile.py) raises _COMPOSITE_PAIR_CAP from 3 to 5, and adds a new _COMPOSITE_REDUNDANCY_RATIO = 3.0 dedup pass before the cut: a pair sharing a column with an already-kept pair is dropped as a near-duplicate ("same dimension, different filler") only when its product is within 3x of the kept pair's a genuinely different hypothesis still gets its own slot even if it reuses that column.
Fixes the crowding case from the issue: several junk pairs anchored on one low-cardinality dimension no longer consume the entire cap and starve out the true grain, which can legitimately score worse on raw distinct-count product.
No change to cost-guard behavior: each extra slot is still a real scan batched into one statement, and a metered adapter that can't cover the wider batch already degrades to "grain unknown" via distinct_combination_counts's existing contract.

The issue :
image

After fix:
image

@marcociav-exmergo marcociav-exmergo changed the title Scrum-1022 issue 168 A crowded low-cardinality dimension no longer pushes the true grain out of the composite-key probe Aug 7, 2026

@marcociav-exmergo marcociav-exmergo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marcociav-exmergo
marcociav-exmergo merged commit 6886936 into main Aug 7, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_COMPOSITE_PAIR_CAP = 3 crowds the true grain out of the candidate set

2 participants