Giter Club home page Giter Club logo

Comments (2)

nakagami avatar nakagami commented on July 19, 2024

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.

hermanius avatar hermanius commented on July 19, 2024
  • 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.