Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

feat: using proper magic numbers in various edge cases #143

Merged
merged 9 commits into from
Mar 30, 2024

Conversation

wangpatrick57
Copy link
Member

@wangpatrick57 wangpatrick57 commented Mar 30, 2024

Summary: Using magic numbers from Postgres in various selectivity edge cases.

Demo:

Different (unfortunately worse) q-error on TPC-H SF1. See #127 for per-query details on how this PR affects q-error.

Screenshot 2024-03-30 at 11 27 24

Details:

  • Fixed the cardinality of Q10!
  • INVALID_SEL is no longer used at all during cardtest. It is still used during plannertest as some plannertests use the optd optimizer instead of the datafusion logical optimizer. This can be checked by replacing all instances of INVALID_SEL with a panic!() and seeing that cardtest still runs.
  • Using magic number from Postgres for LIKE.
  • Using magic number from Postgres for equality with various complex expressions.
  • Using magic number from Postgres for range comparison with various complex expressions.
  • Replaced INVALID_SEL with panic!() and unreachable!() statements in places where it makes sense.

Copy link
Contributor

@Gun9niR Gun9niR left a comment

Choose a reason for hiding this comment

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

LGTM

@wangpatrick57 wangpatrick57 merged commit f42a3cd into main Mar 30, 2024
1 check passed
@wangpatrick57 wangpatrick57 deleted the phw2/filter-sel-edge-cases branch March 30, 2024 17:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants