effizient query with jdbc - Mailing list pgsql-performance

From johannesbuehler@oderbruecke.de
Subject effizient query with jdbc
Date
Msg-id 200512151444.jBFEiNF25690@core.kontent.de
Whole thread Raw
Responses Re: effizient query with jdbc
List pgsql-performance
Hi,
I have a java.util.List of values (10000) which i wanted to use for a query in the where clause of an simple select
statement.iterating over the list and and use an prepared Statement is quite slow. Is there a more efficient way to
executesuch a query.  

Thanks for any help.
Johannes
.....
List ids = new ArrayList();

.... List is filled with 10000 values ...

List uuids = new ArrayList();
PreparedStatement pstat = db.prepareStatement("SELECT UUID FROM MDM.KEYWORDS_INFO WHERE KEYWORDS_ID = ?");
for (Iterator iter = ids.iterator(); iter.hasNext();) {
String id = (String) iter.next();
pstat.setString(1, id);
rs = pstat.executeQuery();
if (rs.next()) {
uuids.add(rs.getString(1));
}
rs.close();
}
...






pgsql-performance by date:

Previous
From: Charles Sprickman
Date:
Subject: SAN/NAS options
Next
From: "Ben Trewern"
Date:
Subject: Speed of different procedural language