-
Notifications
You must be signed in to change notification settings - Fork 3.9k
sql: turn on column family heuristics #7623
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
Conversation
Nice! Do you know where the InsertDistinct100 slowdown comes from? Is it that we were able to do a CPut before and now we first need to do a Get? Review status: 0 of 15 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. sql/testdata/select_non_covering_index, line 25 [r1] (raw file):
Regarding these testcases which aren't specific to families - it's not reasonable to have to update them any time we change the heuristics. We should instead update the "create table" statements in these tests to explicitly set one family per column. Comments from Reviewable |
Also interested in |
Happily, There's an allocation uptick in InsertDistinct, which is probably the cause of the time slowdown. I could pprof it again and see if I can find where that's coming from, but I really can't imaging what's different Review status: 0 of 15 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. Comments from Reviewable |
+34.41% is significant so it would be good to investigate. Can be done later (doesn't need to hold up this PR) but in that case please file an issue. Review status: 0 of 15 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. Comments from Reviewable |
This got really bizarre. When I run only the InsertDistinct benchmark (either on my laptop or gcloud), there is no change. I've done this several times. When I run the 15 minute big suite of sql benchmarks, it repros. Some sort of benchmark bleeding? Review status: 0 of 15 files reviewed at latest revision, 1 unresolved discussion, some commit checks pending. sql/testdata/select_non_covering_index, line 25 [r1] (raw file):
|
... wow I notice there is a lot of variation (±15%) - can you post all the results of What variation do you get if run more iterations (say 100) of InsertDistinct100_Cockroach? BTW are you using Review status: 0 of 15 files reviewed at latest revision, 1 unresolved discussion, some commit checks pending. Comments from Reviewable |
name old time/op new time/op delta Bank2_Cockroach-32 12.2ms ±44% 12.9ms ±35% ~ (p=0.529 n=10+10) Bank4_Cockroach-32 9.32ms ±52% 9.66ms ±39% ~ (p=0.579 n=10+10) Bank8_Cockroach-32 4.44ms ±52% 4.82ms ±26% ~ (p=0.190 n=10+10) Bank16_Cockroach-32 3.09ms ±38% 2.68ms ± 8% ~ (p=0.113 n=9+9) Bank32_Cockroach-32 2.00ms ±26% 2.09ms ±21% ~ (p=0.549 n=9+10) Bank64_Cockroach-32 1.53ms ±14% 1.51ms ±34% ~ (p=0.315 n=10+10) Insert1_Cockroach-32 517µs ± 2% 513µs ± 2% ~ (p=0.165 n=10+10) Insert10_Cockroach-32 671µs ± 2% 671µs ± 2% ~ (p=0.912 n=10+10) Insert100_Cockroach-32 1.82ms ± 3% 1.80ms ± 3% ~ (p=0.247 n=10+10) Insert1000_Cockroach-32 12.2ms ± 3% 12.1ms ± 4% ~ (p=0.065 n=10+9) Update1_Cockroach-32 722µs ± 1% 725µs ± 3% ~ (p=0.853 n=10+10) Update10_Cockroach-32 1.15ms ± 2% 1.13ms ± 3% ~ (p=0.089 n=10+10) Update100_Cockroach-32 4.51ms ± 2% 4.44ms ± 4% ~ (p=0.095 n=9+10) Update1000_Cockroach-32 35.5ms ±10% 33.4ms ± 3% -6.11% (p=0.000 n=10+10) Upsert1_Cockroach-32 1.77ms ± 2% 1.71ms ± 1% -3.33% (p=0.000 n=9+9) Upsert10_Cockroach-32 2.21ms ± 2% 1.95ms ± 2% -11.85% (p=0.000 n=10+9) Upsert100_Cockroach-32 6.85ms ± 2% 4.50ms ± 2% -34.35% (p=0.000 n=10+10) Upsert1000_Cockroach-32 54.6ms ± 5% 29.8ms ± 2% -45.48% (p=0.000 n=9+10) Delete1_Cockroach-32 738µs ± 2% 691µs ± 2% -6.30% (p=0.000 n=10+10) Delete10_Cockroach-32 1.28ms ± 3% 0.86ms ± 1% -32.94% (p=0.000 n=10+10) Delete100_Cockroach-32 6.37ms ± 7% 2.33ms ± 1% -63.43% (p=0.000 n=10+9) Delete1000_Cockroach-32 64.8ms ± 7% 17.6ms ± 6% -72.79% (p=0.000 n=10+10) TrackChoices1_Cockroach-32 607µs ± 5% 593µs ± 2% ~ (p=0.068 n=10+8) TrackChoices10_Cockroach-32 127µs ± 2% 112µs ± 5% -11.13% (p=0.000 n=10+10) TrackChoices100_Cockroach-32 73.0µs ± 4% 60.4µs ± 2% -17.19% (p=0.000 n=10+10) TrackChoices1000_Cockroach-32 67.3µs ± 4% 55.2µs ± 4% -17.97% (p=0.000 n=10+9) InsertDistinct1_Cockroach-32 1.63ms ± 2% 1.62ms ± 2% ~ (p=0.190 n=9+9) InsertDistinct10_Cockroach-32 1.16ms ± 3% 1.15ms ± 3% ~ (p=0.579 n=10+10) InsertDistinct100_Cockroach-32 1.54ms ± 3% 1.55ms ± 3% ~ (p=0.447 n=9+10) WideTable1_Cockroach-32 2.32ms ± 2% 2.31ms ± 2% ~ (p=0.353 n=10+10) WideTable10_Cockroach-32 3.69ms ± 2% 3.64ms ± 1% ~ (p=0.065 n=10+9) WideTable100_Cockroach-32 16.3ms ± 2% 16.3ms ± 4% ~ (p=0.393 n=10+10) WideTable1000_Cockroach-32 138ms ± 1% 137ms ± 2% ~ (p=0.095 n=9+10) name old alloc/op new alloc/op delta Bank2_Cockroach-32 1.07MB ±35% 1.15MB ±34% ~ (p=0.315 n=10+10) Bank4_Cockroach-32 976kB ±31% 971kB ±25% ~ (p=0.684 n=10+10) Bank8_Cockroach-32 573kB ± 7% 619kB ±19% ~ (p=0.211 n=9+10) Bank16_Cockroach-32 431kB ± 6% 420kB ± 4% ~ (p=0.133 n=9+10) Bank32_Cockroach-32 327kB ±19% 334kB ±14% ~ (p=1.000 n=10+10) Bank64_Cockroach-32 262kB ± 3% 259kB ± 4% ~ (p=0.218 n=10+10) Insert1_Cockroach-32 30.2kB ± 0% 30.2kB ± 0% ~ (p=0.091 n=10+7) Insert10_Cockroach-32 75.5kB ± 0% 75.5kB ± 0% ~ (p=0.956 n=10+10) Insert100_Cockroach-32 491kB ± 0% 491kB ± 0% ~ (p=0.887 n=7+10) Insert1000_Cockroach-32 4.17MB ± 0% 4.17MB ± 0% ~ (p=0.780 n=10+9) Update1_Cockroach-32 52.5kB ± 0% 52.3kB ± 0% -0.52% (p=0.000 n=10+10) Update10_Cockroach-32 123kB ± 0% 120kB ± 0% -1.68% (p=0.000 n=7+9) Update100_Cockroach-32 799kB ± 0% 776kB ± 0% -2.83% (p=0.000 n=9+9) Update1000_Cockroach-32 6.56MB ± 0% 6.36MB ± 0% -3.01% (p=0.000 n=8+8) Upsert1_Cockroach-32 105kB ± 0% 99kB ± 0% -5.90% (p=0.000 n=10+10) Upsert10_Cockroach-32 174kB ± 0% 130kB ± 0% -24.93% (p=0.000 n=9+10) Upsert100_Cockroach-32 946kB ± 0% 557kB ± 0% -41.11% (p=0.000 n=9+10) Upsert1000_Cockroach-32 7.91MB ± 1% 4.50MB ± 0% -43.13% (p=0.000 n=10+8) Delete1_Cockroach-32 45.8kB ± 0% 44.4kB ± 0% -2.95% (p=0.000 n=9+10) Delete10_Cockroach-32 71.4kB ± 0% 54.5kB ± 0% -23.64% (p=0.000 n=9+10) Delete100_Cockroach-32 311kB ± 0% 158kB ± 1% -49.08% (p=0.000 n=10+10) Delete1000_Cockroach-32 3.19MB ± 0% 1.07MB ± 0% -66.47% (p=0.000 n=8+9) TrackChoices1_Cockroach-32 47.3kB ± 0% 44.6kB ± 0% -5.63% (p=0.000 n=10+8) TrackChoices10_Cockroach-32 23.8kB ± 0% 16.7kB ± 0% -29.65% (p=0.000 n=8+9) TrackChoices100_Cockroach-32 20.1kB ± 0% 16.1kB ± 0% -19.93% (p=0.000 n=9+6) TrackChoices1000_Cockroach-32 22.7kB ± 0% 17.7kB ± 0% -21.74% (p=0.000 n=9+10) InsertDistinct1_Cockroach-32 306kB ± 0% 306kB ± 0% ~ (p=0.620 n=9+9) InsertDistinct10_Cockroach-32 319kB ± 0% 319kB ± 0% ~ (p=0.971 n=10+10) InsertDistinct100_Cockroach-32 476kB ± 0% 476kB ± 0% ~ (p=0.905 n=9+10) WideTable1_Cockroach-32 172kB ± 0% 172kB ± 0% ~ (p=0.251 n=9+10) WideTable10_Cockroach-32 378kB ± 0% 378kB ± 0% ~ (p=0.278 n=9+10) WideTable100_Cockroach-32 2.38MB ± 0% 2.38MB ± 0% ~ (p=0.661 n=9+10) WideTable1000_Cockroach-32 21.2MB ± 0% 21.2MB ± 0% ~ (p=0.315 n=10+9) name old allocs/op new allocs/op delta Bank2_Cockroach-32 11.7k ±36% 12.4k ±33% ~ (p=0.353 n=10+10) Bank4_Cockroach-32 10.7k ±29% 10.6k ±24% ~ (p=0.796 n=10+10) Bank8_Cockroach-32 6.49k ± 8% 7.01k ±17% ~ (p=0.211 n=9+10) Bank16_Cockroach-32 4.98k ± 7% 4.88k ± 4% ~ (p=0.315 n=9+10) Bank32_Cockroach-32 3.80k ±18% 3.88k ±12% ~ (p=0.912 n=10+10) Bank64_Cockroach-32 3.09k ± 3% 3.07k ± 4% ~ (p=0.698 n=10+10) Insert1_Cockroach-32 302 ± 0% 303 ± 0% ~ (p=0.450 n=10+10) Insert10_Cockroach-32 510 ± 0% 510 ± 0% ~ (all samples are equal) Insert100_Cockroach-32 2.35k ± 0% 2.35k ± 0% ~ (p=0.873 n=10+10) Insert1000_Cockroach-32 20.5k ± 0% 20.5k ± 0% ~ (p=0.643 n=10+10) Update1_Cockroach-32 577 ± 0% 582 ± 0% +0.94% (p=0.000 n=10+10) Update10_Cockroach-32 888 ± 0% 886 ± 0% -0.23% (p=0.000 n=10+10) Update100_Cockroach-32 3.68k ± 0% 3.59k ± 0% -2.41% (p=0.000 n=9+10) Update1000_Cockroach-32 29.7k ± 0% 28.8k ± 0% -2.87% (p=0.000 n=9+8) Upsert1_Cockroach-32 1.16k ± 0% 1.13k ± 0% -2.75% (p=0.001 n=7+7) Upsert10_Cockroach-32 1.55k ± 0% 1.41k ± 0% -9.32% (p=0.000 n=8+10) Upsert100_Cockroach-32 5.69k ± 0% 4.36k ± 0% -23.34% (p=0.000 n=10+10) Upsert1000_Cockroach-32 46.7k ± 0% 33.4k ± 0% -28.44% (p=0.000 n=10+8) Delete1_Cockroach-32 480 ± 0% 468 ± 0% -2.71% (p=0.000 n=10+10) Delete10_Cockroach-32 685 ± 0% 591 ± 0% -13.66% (p=0.000 n=8+10) Delete100_Cockroach-32 2.60k ± 0% 1.69k ± 0% -34.86% (p=0.000 n=9+10) Delete1000_Cockroach-32 21.6k ± 0% 12.6k ± 0% -41.83% (p=0.000 n=8+10) TrackChoices1_Cockroach-32 399 ± 0% 389 ± 0% -2.60% (p=0.000 n=10+8) TrackChoices10_Cockroach-32 118 ± 0% 107 ± 0% -9.32% (p=0.000 n=10+10) TrackChoices100_Cockroach-32 87.0 ± 0% 76.0 ± 0% -12.64% (p=0.000 n=10+8) TrackChoices1000_Cockroach-32 83.0 ± 0% 73.0 ± 0% -12.05% (p=0.000 n=10+10) InsertDistinct1_Cockroach-32 1.91k ± 0% 1.91k ± 0% ~ (p=0.137 n=8+10) InsertDistinct10_Cockroach-32 1.98k ± 0% 1.97k ± 0% ~ (p=0.845 n=10+9) InsertDistinct100_Cockroach-32 3.32k ± 0% 3.32k ± 0% ~ (p=0.386 n=9+9) WideTable1_Cockroach-32 1.97k ± 0% 1.97k ± 0% ~ (p=0.961 n=8+10) WideTable10_Cockroach-32 4.03k ± 0% 4.03k ± 0% ~ (p=0.515 n=10+10) WideTable100_Cockroach-32 24.0k ± 0% 24.0k ± 0% ~ (p=0.669 n=10+10) WideTable1000_Cockroach-32 224k ± 0% 224k ± 0% -0.01% (p=0.042 n=9+9)
Review status: 0 of 16 files reviewed at latest revision, all discussions resolved, some commit checks pending. Comments from Reviewable |
Running the benchmark in a loop with count=1 instead of using count=5 seems to have cleared up the InsertDistinct benchmark. Updated the commit message with the new results Review status: 0 of 16 files reviewed at latest revision, all discussions resolved, all commit checks successful. Comments from Reviewable |
This change is