Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: opt: do not use histograms for constrains outside the min and max #139675

Closed

Conversation

mgartner
Copy link
Collaborator

No description provided.

Copy link

blathers-crl bot commented Jan 23, 2025

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@mgartner mgartner force-pushed the undefined-histogra-filtering branch from 43bfd76 to ad8d1fd Compare January 23, 2025 20:03
@mgartner mgartner force-pushed the undefined-histogra-filtering branch from ad8d1fd to 3b8670e Compare January 23, 2025 20:46
Copy link

blathers-crl bot commented Jan 23, 2025

Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@mgartner
Copy link
Collaborator Author

There was some promise with this experiment, but we ran into problems with inequality filters. With a query like SELECT * FROM t WHERE v > 5000 where 5000 is greater than the max value in v's histogram, we would fallback to assuming a selectivity of 1/3 for v > 5000. This could be a high over-estimation, leading to bad plans in some cases.

We'll continue to think about a change similar to this in the future. For now I'll close it.

@mgartner mgartner closed this Jan 29, 2025
@mgartner mgartner deleted the undefined-histogra-filtering branch January 29, 2025 21:03
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.

2 participants