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

Druid Explore Exactify mode #4397

Merged
merged 5 commits into from
Mar 25, 2024
Merged

Druid Explore Exactify mode #4397

merged 5 commits into from
Mar 25, 2024

Conversation

egor-ryashin
Copy link
Contributor

No description provided.

nishantmonu51
nishantmonu51 previously approved these changes Mar 21, 2024
runtime/queries/metricsview_comparison_toplist.go Outdated Show resolved Hide resolved
@nishantmonu51 nishantmonu51 dismissed their stale review March 21, 2024 20:12

requested more changes.

runtime/queries/metricsview_comparison_toplist.go Outdated Show resolved Hide resolved
Comment on lines +117 to +122
// comparison toplist
if !isTimeRangeNil(q.ComparisonTimeRange) {
// execute toplist for base and get dim list
// create and add filter and execute comprison toplist
// remove strict limits in comp toplist sql
if drivers.DialectDruid != olap.Dialect() || q.Exact {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm worried about how inlined/nested/scattered this fix is since the comparison logic is already tricky to follow. I'm wondering if it could we moved into a separate branch of logic without altering the existing implementation too much? For example, something like this on line 117:

if olap.Dialect() == drivers.DialectDruid && !q.Exact {
  return q.executeDruidApproximate(ctx, olap, mv, priority, security)
}

@egor-ryashin
Copy link
Contributor Author

Benchmarks

BenchmarkMetricsViewsToplist_Druid-10                              	      79	  22788884 ns/op	    8774 B/op	     154 allocs/op
BenchmarkMetricsViewsToplist_Druid_Exactify-10                     	      82	  16689934 ns/op	    8746 B/op	     153 allocs/op
BenchmarkMetricsViewsToplist_Druid_high_cardinality-10             	      16	  74560154 ns/op	   14953 B/op	     206 allocs/op
BenchmarkMetricsViewsToplist_Druid_Exactify_high_cardinality-10    	       8	 138951797 ns/op	   19994 B/op	     219 allocs/op

Copy link
Contributor

@begelundmuller begelundmuller left a comment

Choose a reason for hiding this comment

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

Approving and will address the outstanding comments in a follow up PR

@begelundmuller begelundmuller merged commit 65e7cb0 into main Mar 25, 2024
4 checks passed
@begelundmuller begelundmuller deleted the druid-exactify branch March 25, 2024 16:11
nishantmonu51 pushed a commit that referenced this pull request Mar 25, 2024
* Druid Exactify

* Druid Exactify

* Druid Exactify

* Druid Exactify

* Druid Exactify

---------

Co-authored-by: Egor Ryashin <egor.ryashin@rilldata.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants