Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Index Knobs Support #1623

Merged
merged 25 commits into from
Jul 11, 2021
Merged

Index Knobs Support #1623

merged 25 commits into from
Jul 11, 2021

Conversation

17zhangw
Copy link
Member

@17zhangw 17zhangw commented Jun 23, 2021

Description

Supports specifying index knobs (inner node split/merge threshold) through SQL statements. The following are the big changes in this PR that enable such support:

  • Pipeline Metrics now have 2 additional fields (split/merge for B+trees on OUs that touch indexes)
  • pg_class now has reloptions which contains a string of the key=value options specified
  • CREATE INDEX ... WITH (key=value) parsing support to pass down the options

Remaining Work

  • Reconstruct on recovery
  • Documentation
  • PR through CI

@17zhangw 17zhangw self-assigned this Jun 23, 2021
@17zhangw 17zhangw added the in-progress This PR is being actively worked on and not ready to be reviewed or merged. Mark PRs with this. label Jun 23, 2021
@17zhangw 17zhangw added the ready-for-ci Indicate that this build should be run through CI. label Jun 24, 2021
@noisepage-checks
Copy link

Minor Decrease in Performance

Be warned: this PR may have decreased the throughput of the system slightly.

tps (%change) benchmark_type wal_device details
-1.32% tpcc RAM disk
Detailsmaster tps=22556.43, commit tps=22259.66, query_mode=extended, benchmark_type=tpcc, scale_factor=32.0000, terminals=32, client_time=60, weights={'Payment': 43, 'Delivery': 4, 'NewOrder': 45, 'StockLevel': 4, 'OrderStatus': 4}, wal_device=RAM disk, max_connection_threads=32
-0.36% tpcc None
Detailsmaster tps=29436.04, commit tps=29330.43, query_mode=extended, benchmark_type=tpcc, scale_factor=32.0000, terminals=32, client_time=60, weights={'Payment': 43, 'Delivery': 4, 'NewOrder': 45, 'StockLevel': 4, 'OrderStatus': 4}, wal_device=None, max_connection_threads=32
-0.67% tpcc HDD
Detailsmaster tps=22159.87, commit tps=22011.74, query_mode=extended, benchmark_type=tpcc, scale_factor=32.0000, terminals=32, client_time=60, weights={'Payment': 43, 'Delivery': 4, 'NewOrder': 45, 'StockLevel': 4, 'OrderStatus': 4}, wal_device=HDD, max_connection_threads=32
7.29% tatp RAM disk
Detailsmaster tps=6548.83, commit tps=7026.37, query_mode=extended, benchmark_type=tatp, scale_factor=1.0000, terminals=16, client_time=60, weights={'GetAccessData': 35, 'UpdateLocation': 14, 'GetNewDestination': 10, 'GetSubscriberData': 35, 'DeleteCallForwarding': 2, 'InsertCallForwarding': 2, 'UpdateSubscriberData': 2}, wal_device=RAM disk, max_connection_threads=32
3.4% tatp None
Detailsmaster tps=7309.0, commit tps=7557.68, query_mode=extended, benchmark_type=tatp, scale_factor=1.0000, terminals=16, client_time=60, weights={'GetAccessData': 35, 'UpdateLocation': 14, 'GetNewDestination': 10, 'GetSubscriberData': 35, 'DeleteCallForwarding': 2, 'InsertCallForwarding': 2, 'UpdateSubscriberData': 2}, wal_device=None, max_connection_threads=32
7.58% tatp HDD
Detailsmaster tps=6397.98, commit tps=6882.96, query_mode=extended, benchmark_type=tatp, scale_factor=1.0000, terminals=16, client_time=60, weights={'GetAccessData': 35, 'UpdateLocation': 14, 'GetNewDestination': 10, 'GetSubscriberData': 35, 'DeleteCallForwarding': 2, 'InsertCallForwarding': 2, 'UpdateSubscriberData': 2}, wal_device=HDD, max_connection_threads=32

@codecov
Copy link

codecov bot commented Jun 25, 2021

Codecov Report

Merging #1623 (ff803db) into master (6177239) will decrease coverage by 0.00%.
The diff coverage is 78.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1623      +/-   ##
==========================================
- Coverage   80.83%   80.82%   -0.01%     
==========================================
  Files         774      774              
  Lines       55033    55342     +309     
==========================================
+ Hits        44484    44729     +245     
- Misses      10549    10613      +64     
Impacted Files Coverage Δ
src/catalog/index_schema.cpp 0.00% <0.00%> (ø)
src/include/execution/sql/table_vector_iterator.h 100.00% <ø> (ø)
src/include/execution/vm/bytecode_emitter.h 100.00% <ø> (ø)
src/include/execution/vm/bytecode_handlers.h 69.72% <ø> (ø)
src/include/execution/vm/bytecodes.h 96.42% <ø> (ø)
...de/self_driving/modeling/operating_unit_recorder.h 100.00% <ø> (ø)
src/include/storage/index/bplustree.h 90.98% <ø> (-1.07%) ⬇️
src/include/storage/index/bplustree_index.h 100.00% <ø> (ø)
src/include/storage/index/index_builder.h 100.00% <ø> (ø)
src/optimizer/physical_operators.cpp 89.23% <0.00%> (ø)
... and 41 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6177239...ff803db. Read the comment docs.

@17zhangw 17zhangw added ready-for-review This PR passes all checks and is ready to be reviewed. Mark PRs with this. and removed in-progress This PR is being actively worked on and not ready to be reviewed or merged. Mark PRs with this. labels Jun 25, 2021
@17zhangw 17zhangw requested a review from linmagit June 25, 2021 21:20
Copy link
Member

@linmagit linmagit left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks a lot, William! I only have a minor comment. There are just two additional things:
(1) Could you add a test case for this? I think this could be a SQL test, similar to the analyze_test. We could test that the thresholds for the indexes are set correctly. Ideally, we also want to test that the index is built with the correct number of threads, but it's fine if that's too difficult.
(2) Could you add the OU recording for the parallel create index? I left you some detailed comments on Slack.
Thanks!

@noisepage-checks
Copy link

Minor Decrease in Performance

Be warned: this PR may have decreased the throughput of the system slightly.

tps (%change) benchmark_type wal_device details
-2.4% tpcc RAM disk
Detailsmaster tps=22401.76, commit tps=21864.81, query_mode=extended, benchmark_type=tpcc, scale_factor=32.0000, terminals=32, client_time=60, weights={'Payment': 43, 'Delivery': 4, 'NewOrder': 45, 'StockLevel': 4, 'OrderStatus': 4}, wal_device=RAM disk, max_connection_threads=32
1.54% tpcc None
Detailsmaster tps=29057.98, commit tps=29504.38, query_mode=extended, benchmark_type=tpcc, scale_factor=32.0000, terminals=32, client_time=60, weights={'Payment': 43, 'Delivery': 4, 'NewOrder': 45, 'StockLevel': 4, 'OrderStatus': 4}, wal_device=None, max_connection_threads=32
1.51% tpcc HDD
Detailsmaster tps=21769.33, commit tps=22098.17, query_mode=extended, benchmark_type=tpcc, scale_factor=32.0000, terminals=32, client_time=60, weights={'Payment': 43, 'Delivery': 4, 'NewOrder': 45, 'StockLevel': 4, 'OrderStatus': 4}, wal_device=HDD, max_connection_threads=32
8.73% tatp RAM disk
Detailsmaster tps=6421.59, commit tps=6982.26, query_mode=extended, benchmark_type=tatp, scale_factor=1.0000, terminals=16, client_time=60, weights={'GetAccessData': 35, 'UpdateLocation': 14, 'GetNewDestination': 10, 'GetSubscriberData': 35, 'DeleteCallForwarding': 2, 'InsertCallForwarding': 2, 'UpdateSubscriberData': 2}, wal_device=RAM disk, max_connection_threads=32
-0.08% tatp None
Detailsmaster tps=7430.85, commit tps=7424.59, query_mode=extended, benchmark_type=tatp, scale_factor=1.0000, terminals=16, client_time=60, weights={'GetAccessData': 35, 'UpdateLocation': 14, 'GetNewDestination': 10, 'GetSubscriberData': 35, 'DeleteCallForwarding': 2, 'InsertCallForwarding': 2, 'UpdateSubscriberData': 2}, wal_device=None, max_connection_threads=32
9.64% tatp HDD
Detailsmaster tps=6267.66, commit tps=6872.01, query_mode=extended, benchmark_type=tatp, scale_factor=1.0000, terminals=16, client_time=60, weights={'GetAccessData': 35, 'UpdateLocation': 14, 'GetNewDestination': 10, 'GetSubscriberData': 35, 'DeleteCallForwarding': 2, 'InsertCallForwarding': 2, 'UpdateSubscriberData': 2}, wal_device=HDD, max_connection_threads=32

@17zhangw 17zhangw requested a review from linmagit July 6, 2021 22:27
Copy link
Member

@linmagit linmagit left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks a lot, William!

@linmagit linmagit merged commit 7a199e1 into cmu-db:master Jul 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ready-for-ci Indicate that this build should be run through CI. ready-for-review This PR passes all checks and is ready to be reviewed. Mark PRs with this.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants