Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: data
-
Labels:None
Description
Jody says we'll see speed increases if we use prepared statements, and I imagine he's write. This will require a bit of rearchitecture I imagine, to prepare the statement before's it's used. Oracle is now using the JDBCTextFeatureWriter, as I couldn't get it working with the JDBCFeatureWriter, and couldn't figure out why it wouldn't, just got cryptic errors about not being able to write, something to do with the fid column. This means that this fix will help out both postgis and oracle (but it also means you need to test on both). Jody says he has some code in his oracle/sdo work that he did to use structs with prepared statements. Perhaps he will comment on the exact nature of this.
Issue Links
- is depended upon by
-
GEOS-597
sql-injection
-
* postgres driver does not support prepared statements, it just fakes them, so there is no speed increase in this case (I needed to use them in order to support wkb4j);
* a database that really supports them will optimize the query just once, and then only execute it at each call. Since usually one more round trip to the database is made, there is a speed increase only if you make enough inserts/updates/deletes, usually 20 to 50 depending on the database and the nature of the query.
To really get a sizeable speed increase we should use batch of statements, that really cut the round trips to the database (using addbatch/executebatch). This way the communication with the database occurs only on executebatch. I propose the following:
* you port the prepared statement code from postgres to the other databases;
* I will follow, back from the holidays, and try to add the batch of statements support with some classes of my own that make statement batching as transparent as possible.
What do you think?