X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id F29C69DCC00 for ; Thu, 15 Dec 2005 11:15:02 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 22221-02 for ; Thu, 15 Dec 2005 11:15:07 -0400 (AST) X-Greylist: delayed 00:30:37.275019 by SQLgrey- Received: from core.kontent.de (core.kontent.de [81.88.34.3]) by postgresql.org (Postfix) with ESMTP id 091459DCBFC for ; Thu, 15 Dec 2005 11:14:59 -0400 (AST) Received: (from www@localhost) by core.kontent.de (8.11.4/8.11.4) id jBFEiNF25690; Thu, 15 Dec 2005 15:44:23 +0100 Message-Id: <200512151444.jBFEiNF25690@core.kontent.de> X-Authentication-Warning: core.kontent.de: www set sender to johannesbuehler@oderbruecke.de using -f To: pgsql-performance@postgresql.org Subject: effizient query with jdbc Date: Thu, 15 Dec 2005 15:44:23 +0100 From: johannesbuehler@oderbruecke.de Reply-To: johannesbuehler@oderbruecke.de MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-Transfer-Encoding: QUOTED-PRINTABLE X-Mailer: KONTENT WebMail (http://www.kontent.de/) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.55 required=5 tests=[NO_REAL_NAME=0.55] X-Spam-Score: 0.55 X-Spam-Level: X-Archive-Number: 200512/522 X-Sequence-Number: 16343 Hi,=20 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 execute such a query.=20 Thanks for any help.=20 Johannes=20 .....=20 List ids =3D new ArrayList(); .... List is filled with 10000 values ... List uuids =3D new ArrayList();=20 PreparedStatement pstat =3D db.prepareStatement("SELECT UUID FROM MDM.KEYWO= RDS_INFO WHERE KEYWORDS_ID =3D ?");=20 for (Iterator iter =3D ids.iterator(); iter.hasNext();) { String id =3D (String) iter.next(); pstat.setString(1, id); rs =3D pstat.executeQuery(); if (rs.next()) { uuids.add(rs.getString(1)); } rs.close(); }=20 ...=20