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

H-3814: Create remaining indices for link reference tables #5905

Merged

Conversation

TimDiekmann
Copy link
Member

🌟 What is the purpose of this PR?

We currently only have indices on one side of the link reference tables. This adds the other side as well.

@TimDiekmann TimDiekmann requested a review from a team as a code owner December 13, 2024 17:50
@TimDiekmann TimDiekmann self-assigned this Dec 13, 2024
@github-actions github-actions bot added area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team labels Dec 13, 2024
Copy link
Contributor

Benchmark results

@rust/hash-graph-benches – Integrations

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$17.7 \mathrm{ms} \pm 222 \mathrm{μs}\left({\color{lightgreen}-26.762 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$16.6 \mathrm{ms} \pm 213 \mathrm{μs}\left({\color{gray}3.54 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$17.3 \mathrm{ms} \pm 217 \mathrm{μs}\left({\color{gray}2.86 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$17.5 \mathrm{ms} \pm 209 \mathrm{μs}\left({\color{gray}1.58 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$17.1 \mathrm{ms} \pm 222 \mathrm{μs}\left({\color{gray}2.43 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$16.3 \mathrm{ms} \pm 155 \mathrm{μs}\left({\color{lightgreen}-7.204 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$16.6 \mathrm{ms} \pm 185 \mathrm{μs}\left({\color{gray}-1.370 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$17.3 \mathrm{ms} \pm 194 \mathrm{μs}\left({\color{lightgreen}-27.410 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$17.2 \mathrm{ms} \pm 208 \mathrm{μs}\left({\color{lightgreen}-13.250 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property depths: DT=255, PT=255, ET=255, E=255 $$66.8 \mathrm{ms} \pm 252 \mathrm{μs}\left({\color{gray}0.044 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=0 $$39.4 \mathrm{ms} \pm 184 \mathrm{μs}\left({\color{gray}-0.022 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=2, PT=2, ET=2, E=2 $$57.4 \mathrm{ms} \pm 346 \mathrm{μs}\left({\color{gray}-0.138 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=2 $$43.2 \mathrm{ms} \pm 213 \mathrm{μs}\left({\color{gray}-0.854 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=2, E=2 $$49.0 \mathrm{ms} \pm 224 \mathrm{μs}\left({\color{gray}-0.119 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=2, ET=2, E=2 $$54.0 \mathrm{ms} \pm 454 \mathrm{μs}\left({\color{gray}0.092 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=255, PT=255, ET=255, E=255 $$107 \mathrm{ms} \pm 506 \mathrm{μs}\left({\color{gray}-2.989 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=0 $$43.6 \mathrm{ms} \pm 197 \mathrm{μs}\left({\color{gray}0.861 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=2, PT=2, ET=2, E=2 $$98.3 \mathrm{ms} \pm 435 \mathrm{μs}\left({\color{gray}-2.063 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=2 $$81.4 \mathrm{ms} \pm 294 \mathrm{μs}\left({\color{gray}-1.421 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=2, E=2 $$89.8 \mathrm{ms} \pm 353 \mathrm{μs}\left({\color{gray}-3.468 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=2, ET=2, E=2 $$95.3 \mathrm{ms} \pm 560 \mathrm{μs}\left({\color{gray}-1.793 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity_type

Function Value Mean Flame graphs
get_entity_type_by_id Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579 $$1.40 \mathrm{ms} \pm 4.08 \mathrm{μs}\left({\color{gray}0.580 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_one_depth

Function Value Mean Flame graphs
entity_by_id 50 entities $$5.43 \mathrm{s} \pm 544 \mathrm{ms}\left({\color{red}1890 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$26.8 \mathrm{ms} \pm 120 \mathrm{μs}\left({\color{gray}-0.207 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$20.8 \mathrm{ms} \pm 109 \mathrm{μs}\left({\color{gray}2.02 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$57.9 \mathrm{ms} \pm 154 \mathrm{μs}\left({\color{gray}-0.220 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$178 \mathrm{ms} \pm 736 \mathrm{μs}\left({\color{gray}-0.060 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$1.96 \mathrm{ms} \pm 5.90 \mathrm{μs}\left({\color{gray}0.788 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$2.12 \mathrm{ms} \pm 8.65 \mathrm{μs}\left({\color{gray}1.19 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$1.95 \mathrm{ms} \pm 7.08 \mathrm{μs}\left({\color{gray}0.490 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$2.86 \mathrm{ms} \pm 11.4 \mathrm{μs}\left({\color{gray}0.501 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$9.35 \mathrm{ms} \pm 102 \mathrm{μs}\left({\color{lightgreen}-5.582 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_zero_depth

Function Value Mean Flame graphs
entity_by_id 50 entities $$4.06 \mathrm{ms} \pm 31.6 \mathrm{μs}\left({\color{gray}-0.871 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$1.98 \mathrm{ms} \pm 11.4 \mathrm{μs}\left({\color{gray}-0.160 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$1.94 \mathrm{ms} \pm 6.95 \mathrm{μs}\left({\color{gray}-0.305 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$2.10 \mathrm{ms} \pm 10.7 \mathrm{μs}\left({\color{gray}-3.231 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$3.36 \mathrm{ms} \pm 12.7 \mathrm{μs}\left({\color{gray}0.852 \mathrm{\%}}\right) $$ Flame Graph

Merged via the queue into main with commit 75a0aef Dec 13, 2024
88 checks passed
@TimDiekmann TimDiekmann deleted the t/h-3814-create-remaining-indices-for-link-reference-tables branch December 13, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team
Development

Successfully merging this pull request may close these issues.

2 participants