-
Notifications
You must be signed in to change notification settings - Fork 26
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
Real support for Prepared Statements #7
Comments
You are quite right, which is why I have this comment in Statement.hsc: -- FIXME: we currently do no prepare optimization whatsoever. I probably don't have time to work on this right away, but I agree it should be fixed. |
Hi! I am interested in working on this. I would like to get my work upstream, so I have some questions about the structure of the current code and how to proceed. Currently, DB.HDBC.Statement.newSth is used to create new Statements. These Statements don't provide statement preparation. Also, newSth is used in DB.HDBC.Connection to implement frunRaw, frun and fgetTables. These are places where statement preparation should not be done. So I thought, the first step towards fixing this ticket would be to untangle the two different cases (that is, using newSth for unprepared and prepared Statements). My fork shows some preliminary work on this: soenkehahn@2d070dc Here are my questions:
I hope what I wrote is understandable and I would really appreciate any feedback on this. Cheers and thanks, |
Hi Sönke, I'm really glad you're keen to help with this and would welcome your contributions. I actually suggest that you don't create a new |
I am working on this right now, thanks. |
I have done some patches for this in my fork: https://github.com/soenkehahn/hdbc-postgresql
I would be happy for any comments on these (or other) issues. |
Hm, lots of interesting issues here. Point by point:
|
Having thought about this some more, I think that it's fine for |
I agree. I'm assuming we'll leave it like this then. I will try to tackle deallocation and internal error handling. |
Hi! I've been looking into deallocation of prepared statements today. I thought this should be done by the operation in the 'finish'-field of the statement, but that was apperently a misunderstanding: 'finish' is just for reinitializing a statement after a single execution of the statement. As far as I can see, there is no way to deallocate a prepared statement using the HDBC-API. Is this correct? |
The HDBC API supports "prepared" statements, however the PostgreSQL currently doesn't do anything with this. Instead, the query string will be sent to the database repeatedly, which means that the database will have to repeatedly re-parse the query and re-create a query plan.
The text was updated successfully, but these errors were encountered: