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

Invalidate column name caches when the schema of table may change #1056

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

zhuzilin
Copy link
Collaborator

@zhuzilin zhuzilin commented Aug 12, 2022

fix #921.

This won't affect the benchmark result. In my environment, the result of bench/sqlite/bun.js is:
before:

cpu: Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
runtime: bun 0.1.8_debug (x64-linux)

benchmark                        time (avg)             (min … max)       p75       p99      p995
------------------------------------------------------------------- -----------------------------
SELECT * FROM "Order"         60.08 ms/iter    (55.76 ms … 62.9 ms)  61.04 ms   62.9 ms   62.9 ms
SELECT * FROM "Product"      139.96 µs/iter   (115.86 µs … 1.37 ms) 140.19 µs 210.96 µs 237.65 µs
SELECT * FROM "OrderDetail"  668.64 ms/iter (657.35 ms … 691.36 ms) 674.38 ms 691.36 ms 691.36 ms

after

benchmark                        time (avg)             (min … max)       p75       p99      p995
------------------------------------------------------------------- -----------------------------
SELECT * FROM "Order"         61.04 ms/iter   (57.15 ms … 62.79 ms)  61.53 ms  62.79 ms  62.79 ms
SELECT * FROM "Product"      142.77 µs/iter   (118.23 µs … 1.71 ms) 142.28 µs 216.04 µs 239.18 µs
SELECT * FROM "OrderDetail"  686.22 ms/iter (670.32 ms … 713.47 ms) 697.33 ms 713.47 ms 713.47 ms

Thank you for your time on this PR :)

@Jarred-Sumner Jarred-Sumner merged commit bcc4580 into oven-sh:main Aug 12, 2022
@Jarred-Sumner
Copy link
Collaborator

This is great!

Copy link
Contributor

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

Huh? What if you alter table from another process? This just seems to invalidate when there is a schema change through the API.

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