Navigation Menu

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

Add ?_cache_size=[..] to connection parameters #894

Merged
merged 1 commit into from Dec 26, 2020
Merged

Add ?_cache_size=[..] to connection parameters #894

merged 1 commit into from Dec 26, 2020

Conversation

arp242
Copy link
Contributor

@arp242 arp242 commented Dec 26, 2020

Add a shortcut for PRAGMA cache_size; this is a pretty useful setting:
the default of -2000 (2M) is not especially high, and a lot of people
will probably want to increase this.

For example, while running a bunch of fairy expensive queries in
parallel:

With SetMaxOpenConns(1):
 -2000:  5762ms
-20000:  4714ms

With SetMaxOpenConns(20):
 -2000:  3067ms
-20000:  2532ms

Which isn't a bad performance boost for changing a single number.

Add a shortcut for PRAGMA cache_size; this is a pretty useful setting:
the default of -2000 (2M) is not especially high, and a lot of people
will probably want to increase this.

For example, while running a bunch of fairy expensive queries in
parallel:

	With SetMaxOpenConns(1):
	 -2000:  5762ms
	-20000:  4714ms

	With SetMaxOpenConns(20):
	 -2000:  3067ms
	-20000:  2532ms

Which isn't a bad performance boost for changing a single number.
@codecov-io
Copy link

codecov-io commented Dec 26, 2020

Codecov Report

Merging #894 (c240601) into master (223d277) will decrease coverage by 0.25%.
The diff coverage is 10.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #894      +/-   ##
==========================================
- Coverage   46.92%   46.67%   -0.26%     
==========================================
  Files          11       11              
  Lines        1447     1457      +10     
==========================================
+ Hits          679      680       +1     
- Misses        635      642       +7     
- Partials      133      135       +2     
Impacted Files Coverage Δ
sqlite3.go 52.90% <10.00%> (-0.49%) ⬇️

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 223d277...c240601. Read the comment docs.

@mattn mattn merged commit 02ce7ec into mattn:master Dec 26, 2020
@mattn
Copy link
Owner

mattn commented Dec 26, 2020

Thank you

@arp242 arp242 deleted the cache_size branch December 26, 2020 14:12
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.

None yet

3 participants