X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3931253613 for ; Fri, 8 Apr 2005 19:44:59 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 08263-05 for ; Fri, 8 Apr 2005 18:44:50 +0000 (GMT) Received: from mail.dialmex.net (67.107.77.98.ptr.us.xo.net [67.107.77.98]) by svr1.postgresql.org (Postfix) with ESMTP id 41CDF535EF for ; Fri, 8 Apr 2005 19:44:48 +0100 (BST) Received: from david.dialmex.net (dmxnocws13.dialmex.net [67.107.77.78]) by mail.dialmex.net (Postfix) with ESMTP id 204C9EE98E; Fri, 8 Apr 2005 13:44:47 -0500 (CDT) Received: by david.dialmex.net (Postfix, from userid 4001) id 18B1C1472A87; Fri, 8 Apr 2005 13:44:47 -0500 (CDT) Subject: Re: [Dbdpg-general] benchmarking old Pg and DBD::Pg From: David Stanaway To: Vlad Cc: Brandon Metcalf , dbdpg-general@gborg.postgresql.org, pgsql-interfaces@postgresql.org In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Fri, 08 Apr 2005 13:44:46 -0500 Message-Id: <1112985886.19084.8.camel@david.dialmex.net> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200504/32 X-Sequence-Number: 5448 On Fri, 2005-04-08 at 14:12 -0400, Vlad wrote: > we've noticed that too here and quick explanation is - with the new > "prepare" implementation, the query get prepared on the server side, > which is good; the problem is that all of the bind values passed to > the sql server during execute call are in form of ***varchar***, i.e. > even if a field is of int type in postgresql table, DBD::Pg passes > your bind value as char - as a result, postgresql doesn't use indexes. A work around would be in the sql to cast the param to the appropriate type. EG: SELECT * FROM Person WHERE personid = %::int -- David Stanaway