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 E96E553C8D for ; Fri, 8 Apr 2005 20:07:11 +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 12510-10 for ; Fri, 8 Apr 2005 19:07:07 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.194]) by svr1.postgresql.org (Postfix) with ESMTP id 339D053CCB for ; Fri, 8 Apr 2005 20:07:06 +0100 (BST) Received: by wproxy.gmail.com with SMTP id 69so1137781wri for ; Fri, 08 Apr 2005 12:07:07 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=NId9LgFDVWEnCjwJtAhXMTYsHXrbLRIM5Nu0WMofLtwV2+q7qjBw3el5jCv+cJgbZ6jtjn0MXrFI1EHP+p0PS2054OChHQiuTH1N6nRM7/7S0VT1mtmSg1MzNZn2/9DTvobNSY8DtXR1uyEByJeKMQfjzr+UxSKSvW6WdFSRTVY= Received: by 10.54.47.56 with SMTP id u56mr759345wru; Fri, 08 Apr 2005 12:07:06 -0700 (PDT) Received: by 10.54.45.39 with HTTP; Fri, 8 Apr 2005 12:07:04 -0700 (PDT) Message-ID: Date: Fri, 8 Apr 2005 15:07:04 -0400 From: Vlad Reply-To: Vlad To: David Stanaway Subject: Re: [Dbdpg-general] benchmarking old Pg and DBD::Pg Cc: Brandon Metcalf , dbdpg-general@gborg.postgresql.org, pgsql-interfaces@postgresql.org In-Reply-To: <1112985886.19084.8.camel@david.dialmex.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <1112985886.19084.8.camel@david.dialmex.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.267 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200504/33 X-Sequence-Number: 5449 David, it's acceptible (actually better in form of passing columns type via bind_values) as a quick workaround for a small scripts only. Actually as a quick workarround it's easier to downgrade DBD::Pg. Think of numerouse DB-OO Mappers and Object Persistance tools... it won't be easy to fix all of them. As of right now a lot of times you get screwed if you upgrade DBD::Pg to 1.40-1.41. On Apr 8, 2005 2:44 PM, David Stanaway wrote: > 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 -- Vlad