Comments (2)
I am opposed to caching prepaid statements at the client for the following reasons
- It would be complicated
- It uses a lot of memory
- Can't handle statement processing leaks well?
Since db_connection's handle_decrate() and handle_deallocate() handle the equivalent of Firebird's statement handles, wouldn't it be better for functions that use db_connection to cache them?
from firebirdex.
- It would be complicated: Maybe I'm overlooking some of the complexity, but hashing the statements and using the hash as a key in an ETS table does not seem to be so complicated at first sight. Where exactly do you see the complexity? (Of course I'm willing to help out)
- It uses a lot of memory : I will have to figure out how much memory is used to cache a statement, but memory use could be limited by max_prepared_statements and cleanup of oldest or least used statements when the maximum is reached.
And of course there is still the option of completely opting out of prepared statement caching with a keep_prepared_statements? connection option, defaulting to false, or setting max_prepared_statements to 0. - Can't handle statement processing leaks well? : I don't really understand this one.
Since db_connection's handle_decrate() and handle_deallocate() handle the equivalent of Firebird's statement handles, wouldn't it be better for functions that use db_connection to cache them?
Isn't it Firebirdex that is using the DBConnection functions, and therefore indeed a good candidate to do the caching?
I'm just launching an idea. I'm perfectly fine if you don't like the idea, and want to close the issue. I can still do a prepared statement cache outside of Firebirdex. No hard feelings at all, and very grateful that you have created this great library.
from firebirdex.
Related Issues (9)
- encoding not found HOT 2
- encoding error in transaction HOT 4
- Arithmic Error HOT 18
- Empty string returns [] HOT 1
- Unable to connect with docker on MacOS HOT 10
- DBConnection.close misinterpretation? HOT 9
- Pending transactions HOT 57
- Charsets HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebirdex.