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

fix(vitess): Expand foreign key introspection query to match vttestserver scenario #4514

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

janpio
Copy link
Contributor

@janpio janpio commented Dec 3, 2023

No description provided.

@janpio janpio changed the title fix(vitess): Expand constraint introspection query to match vttestserver scenario fix(vitess): Expand foreign key introspection query to match vttestserver scenario Dec 3, 2023
Copy link

codspeed-hq bot commented Dec 3, 2023

CodSpeed Performance Report

Merging #4514 will not alter performance

Comparing integration/vitess-constraint-fix (ca25146) with main (e5f3dd7)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

WASM Query Engine file Size

Engine This PR Base branch Diff
Postgres 2.130MiB 2.130MiB 0.000B
Postgres (gzip) 838.789KiB 838.788KiB 1.000B
Mysql 2.098MiB 2.098MiB 0.000B
Mysql (gzip) 825.534KiB 825.533KiB 1.000B
Sqlite 1.991MiB 1.991MiB 0.000B
Sqlite (gzip) 785.918KiB 785.917KiB 2.000B

Copy link
Contributor

✅ WASM query-engine performance won't change substantially (0.995x)

Full benchmark report
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/bench?schema=imdb_bench&sslmode=disable" \
node --experimental-wasm-modules query-engine/driver-adapters/executor/dist/bench.mjs
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
cpu: AMD EPYC 7763 64-Core Processor
runtime: node v18.20.2 (x64-linux)

benchmark                   time (avg)             (min … max)       p75       p99      p999
-------------------------------------------------------------- -----------------------------
• movies.findMany() (all - ~50K)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     370 ms/iter       (366 ms … 377 ms)    376 ms    377 ms    377 ms
Web Assembly: Latest       456 ms/iter       (454 ms … 462 ms)    457 ms    462 ms    462 ms
Web Assembly: Current      457 ms/iter       (450 ms … 466 ms)    460 ms    466 ms    466 ms
Node API: Current          198 ms/iter       (196 ms … 201 ms)    201 ms    201 ms    201 ms

summary for movies.findMany() (all - ~50K)
  Web Assembly: Current
   2.31x slower than Node API: Current
   1.23x slower than Web Assembly: Baseline
   1x faster than Web Assembly: Latest

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  15'200 µs/iter (14'783 µs … 18'036 µs) 15'082 µs 18'036 µs 18'036 µs
Web Assembly: Latest    18'405 µs/iter (18'174 µs … 21'753 µs) 18'337 µs 21'753 µs 21'753 µs
Web Assembly: Current   18'111 µs/iter (17'980 µs … 18'432 µs) 18'134 µs 18'432 µs 18'432 µs
Node API: Current        8'179 µs/iter  (7'855 µs … 12'627 µs)  8'044 µs 12'627 µs 12'627 µs

summary for movies.findMany({ take: 2000 })
  Web Assembly: Current
   2.21x slower than Node API: Current
   1.19x slower than Web Assembly: Baseline
   1.02x faster than Web Assembly: Latest

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   2'328 µs/iter   (2'207 µs … 3'536 µs)  2'318 µs  3'419 µs  3'536 µs
Web Assembly: Latest     2'867 µs/iter   (2'770 µs … 3'640 µs)  2'862 µs  3'450 µs  3'640 µs
Web Assembly: Current    2'846 µs/iter   (2'755 µs … 3'683 µs)  2'832 µs  3'531 µs  3'683 µs
Node API: Current        1'378 µs/iter   (1'299 µs … 1'884 µs)  1'392 µs  1'613 µs  1'884 µs

summary for movies.findMany({ where: {...}, take: 2000 })
  Web Assembly: Current
   2.06x slower than Node API: Current
   1.22x slower than Web Assembly: Baseline
   1.01x faster than Web Assembly: Latest

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     570 ms/iter       (561 ms … 583 ms)    581 ms    583 ms    583 ms
Web Assembly: Latest       781 ms/iter       (774 ms … 801 ms)    786 ms    801 ms    801 ms
Web Assembly: Current      772 ms/iter       (769 ms … 777 ms)    775 ms    777 ms    777 ms
Node API: Current          478 ms/iter       (468 ms … 492 ms)    490 ms    492 ms    492 ms

summary for movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
  Web Assembly: Current
   1.62x slower than Node API: Current
   1.35x slower than Web Assembly: Baseline
   1.01x faster than Web Assembly: Latest

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  78'245 µs/iter (77'828 µs … 78'753 µs) 78'478 µs 78'753 µs 78'753 µs
Web Assembly: Latest       109 ms/iter       (109 ms … 110 ms)    109 ms    110 ms    110 ms
Web Assembly: Current      108 ms/iter       (108 ms … 109 ms)    109 ms    109 ms    109 ms
Node API: Current       62'766 µs/iter (61'794 µs … 64'176 µs) 64'140 µs 64'176 µs 64'176 µs

summary for movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
  Web Assembly: Current
   1.73x slower than Node API: Current
   1.38x slower than Web Assembly: Baseline
   1.01x faster than Web Assembly: Latest

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     998 ms/iter     (992 ms … 1'008 ms)  1'002 ms  1'008 ms  1'008 ms
Web Assembly: Latest     1'300 ms/iter   (1'292 ms … 1'315 ms)  1'301 ms  1'315 ms  1'315 ms
Web Assembly: Current    1'290 ms/iter   (1'283 ms … 1'305 ms)  1'299 ms  1'305 ms  1'305 ms
Node API: Current          876 ms/iter       (860 ms … 914 ms)    899 ms    914 ms    914 ms

summary for movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
  Web Assembly: Current
   1.47x slower than Node API: Current
   1.29x slower than Web Assembly: Baseline
   1.01x faster than Web Assembly: Latest

• movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     141 ms/iter       (139 ms … 142 ms)    142 ms    142 ms    142 ms
Web Assembly: Latest       181 ms/iter       (180 ms … 183 ms)    182 ms    183 ms    183 ms
Web Assembly: Current      183 ms/iter       (180 ms … 185 ms)    184 ms    185 ms    185 ms
Node API: Current          109 ms/iter       (108 ms … 111 ms)    110 ms    111 ms    111 ms

summary for movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
  Web Assembly: Current
   1.67x slower than Node API: Current
   1.3x slower than Web Assembly: Baseline
   1.01x slower than Web Assembly: Latest

• movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'043 µs/iter     (983 µs … 1'801 µs)  1'039 µs  1'646 µs  1'801 µs
Web Assembly: Latest     1'384 µs/iter   (1'309 µs … 2'187 µs)  1'380 µs  1'959 µs  2'187 µs
Web Assembly: Current    1'392 µs/iter   (1'301 µs … 2'470 µs)  1'374 µs  2'222 µs  2'470 µs
Node API: Current          761 µs/iter     (704 µs … 1'121 µs)    792 µs    838 µs  1'121 µs

summary for movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
  Web Assembly: Current
   1.83x slower than Node API: Current
   1.33x slower than Web Assembly: Baseline
   1.01x slower than Web Assembly: Latest

• movie.findMany({ where: { cast: { person: { ... } }, take: 100 }) (m2m -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'029 µs/iter     (990 µs … 1'584 µs)  1'038 µs  1'343 µs  1'584 µs
Web Assembly: Latest     1'366 µs/iter   (1'312 µs … 1'734 µs)  1'373 µs  1'674 µs  1'734 µs
Web Assembly: Current    1'360 µs/iter   (1'303 µs … 1'830 µs)  1'369 µs  1'664 µs  1'830 µs
Node API: Current          782 µs/iter     (713 µs … 1'223 µs)    796 µs    852 µs  1'223 µs

summary for movie.findMany({ where: { cast: { person: { ... } }, take: 100 }) (m2m -> to-one)
  Web Assembly: Current
   1.74x slower than Node API: Current
   1.32x slower than Web Assembly: Baseline
   1x faster than Web Assembly: Latest

After changes in ca25146

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant