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

Stopgap: Postgres Foreign Data Wrappers #4020

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

Conversation

Druue
Copy link
Contributor

@Druue Druue commented Jun 6, 2023

include foreign tables in describe, initial basic pg test snapshot

closes https://github.com/prisma/team-orm/issues/183

@codspeed-hq
Copy link

codspeed-hq bot commented Jun 6, 2023

CodSpeed Performance Report

Merging #4020 will not alter performance

Comparing gap/foreign_data_wrappers (4d1bf64) with main (fecfd2f)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

github-actions bot commented Jan 5, 2024

WASM Size

Engine This PR Base branch Diff
WASM 2.744MiB 2.744MiB 0.000B
WASM (gzip) 1.006MiB 1.006MiB 0.000B

Copy link
Contributor

github-actions bot commented Jan 5, 2024

✅ WASM query-engine: no benchmarks have regressed

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.19.0 (x64-linux)

benchmark                   time (avg)             (min … max)       p75       p99      p995
-------------------------------------------------------------- -----------------------------
• movies.findMany() (all - 25000)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  318.36 ms/iter (314.92 ms … 337.18 ms) 317.55 ms 337.18 ms 337.18 ms
Web Assembly: Latest    312.84 ms/iter (309.77 ms … 315.41 ms) 313.52 ms 315.41 ms 315.41 ms
Web Assembly: Current   315.91 ms/iter     (312 ms … 322.8 ms) 317.43 ms  322.8 ms  322.8 ms
Node API: Current       235.08 ms/iter (222.01 ms … 244.55 ms) 241.54 ms 244.55 ms 244.55 ms

summary for movies.findMany() (all - 25000)
  Web Assembly: Current
   1.34x slower than Node API: Current
   1.01x slower than Web Assembly: Latest
   1.01x faster than Web Assembly: Baseline

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.55 ms/iter   (12.03 ms … 15.32 ms)  12.62 ms  15.32 ms  15.32 ms
Web Assembly: Latest     12.84 ms/iter   (12.41 ms … 15.34 ms)   12.8 ms  15.34 ms  15.34 ms
Web Assembly: Current       13 ms/iter   (12.17 ms … 17.64 ms)  12.92 ms  17.64 ms  17.64 ms
Node API: Current         9.47 ms/iter    (9.18 ms … 13.41 ms)   9.51 ms  13.41 ms  13.41 ms

summary for movies.findMany({ take: 2000 })
  Web Assembly: Current
   1.37x slower than Node API: Current
   1.04x slower than Web Assembly: Baseline
   1.01x slower than Web Assembly: Latest

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline    2.02 ms/iter     (1.87 ms … 3.46 ms)   1.97 ms    3.4 ms   3.42 ms
Web Assembly: Latest      2.04 ms/iter     (1.84 ms … 4.56 ms)      2 ms   3.43 ms   3.74 ms
Web Assembly: Current     1.95 ms/iter     (1.83 ms … 3.71 ms)   1.92 ms   3.37 ms   3.39 ms
Node API: Current         1.57 ms/iter     (1.46 ms … 2.16 ms)   1.57 ms   1.89 ms   2.06 ms

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

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.75 ms/iter      (12 ms … 17.54 ms)   12.7 ms  17.54 ms  17.54 ms
Web Assembly: Latest     12.54 ms/iter   (12.19 ms … 13.64 ms)  12.64 ms  13.64 ms  13.64 ms
Web Assembly: Current    12.52 ms/iter    (12.15 ms … 13.1 ms)  12.64 ms   13.1 ms   13.1 ms
Node API: Current         9.65 ms/iter    (9.22 ms … 10.71 ms)   9.77 ms  10.71 ms  10.71 ms

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

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline    1.95 ms/iter     (1.83 ms … 3.08 ms)   1.93 ms   2.72 ms   2.74 ms
Web Assembly: Latest       1.9 ms/iter     (1.82 ms … 2.62 ms)    1.9 ms   2.45 ms   2.49 ms
Web Assembly: Current     1.91 ms/iter     (1.82 ms … 2.95 ms)    1.9 ms   2.61 ms    2.9 ms
Node API: Current         1.57 ms/iter     (1.49 ms … 1.88 ms)   1.58 ms   1.83 ms   1.84 ms

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

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.59 ms/iter   (11.98 ms … 18.17 ms)  12.56 ms  18.17 ms  18.17 ms
Web Assembly: Latest     12.51 ms/iter   (12.16 ms … 17.45 ms)  12.49 ms  17.45 ms  17.45 ms
Web Assembly: Current    12.72 ms/iter   (11.96 ms … 15.94 ms)  12.73 ms  15.94 ms  15.94 ms
Node API: Current         9.49 ms/iter    (9.08 ms … 10.05 ms)   9.57 ms  10.05 ms  10.05 ms

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

• movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline    1.92 ms/iter     (1.83 ms … 3.21 ms)   1.91 ms    2.5 ms   2.77 ms
Web Assembly: Latest      1.89 ms/iter     (1.81 ms … 3.01 ms)   1.89 ms   2.35 ms   2.39 ms
Web Assembly: Current     1.91 ms/iter     (1.82 ms … 6.62 ms)   1.89 ms   2.35 ms   2.42 ms
Node API: Current         1.66 ms/iter     (1.52 ms … 2.83 ms)   1.62 ms   2.69 ms   2.78 ms

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

• movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  952.39 µs/iter    (864.85 µs … 1.9 ms) 940.37 µs   1.52 ms   1.57 ms
Web Assembly: Latest    925.05 µs/iter   (871.69 µs … 1.55 ms) 923.07 µs   1.46 ms    1.5 ms
Web Assembly: Current   927.77 µs/iter   (877.63 µs … 1.43 ms)  934.6 µs   1.23 ms   1.29 ms
Node API: Current       858.06 µs/iter   (779.03 µs … 1.43 ms) 870.51 µs   1.22 ms   1.35 ms

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

• movie.findMany({ where: { cast: { person: { ... } }, take: 100 }) (m2m -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  916.79 µs/iter   (858.56 µs … 1.45 ms) 919.89 µs   1.33 ms   1.39 ms
Web Assembly: Latest    897.14 µs/iter   (850.51 µs … 1.39 ms) 900.83 µs   1.21 ms   1.29 ms
Web Assembly: Current   902.43 µs/iter   (859.52 µs … 1.45 ms) 904.39 µs   1.23 ms   1.42 ms
Node API: Current       842.31 µs/iter   (768.87 µs … 1.15 ms)  865.7 µs   1.04 ms   1.05 ms

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

After changes in 4d1bf64

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

Successfully merging this pull request may close these issues.

None yet

1 participant