
The idea of prepared statements is to prepare a query template once and then call (re-use) it with different parameters multiple times, i.e., for 1000 inserts you would to one prepareStatement (and hence pay the cost for translating, optimizing that query and storing its execution plan only once) and then call (execute) it multiple times with (potentially) different parameters (arguments), at ver low cost and it then is merely calling a pre-compiled function ...
This is a general idea, not MonetDB specific ...
Thank you for your help to solve our problem and sorry for my persistence. But it will be good if monetdb could determine equals PreparedStatements. We have client-server application. Client side use JDBC driver. Server side - MonetDB. Server side receive requests from client with different parameters. One of them is PreparedStatements. Client side can behave optimaly (reuse PreparedStatements objects) and not optimaly (create new PreparedStatements every request from other clients, as Spring Fraimwork do by default). Or for example client has connection pool, and for eache connection we will have one PreparedStatement (let's it be 10 connections). But independently of how client works, server should work optimaly. And if it is create precompiled functions according to some parameters, It is very good if server will not duplicate the same precompiled function for equals parameters. Is it practically possible to determine that two prepared statements equals? -- Best regards, Andrey.