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 20C4453740 for ; Fri, 8 Apr 2005 19:40:14 +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 07383-03 for ; Fri, 8 Apr 2005 18:40:05 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.202]) by svr1.postgresql.org (Postfix) with ESMTP id DFE5D53722 for ; Fri, 8 Apr 2005 19:40:03 +0100 (BST) Received: by wproxy.gmail.com with SMTP id 69so1129755wri for ; Fri, 08 Apr 2005 11:40:04 -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=I/gMy16OaWwl0ozWIMdW226d5JPph5zcVBE17SMsPGkjcA3ViYpGcQfyRSveKRS7eXS+1xRJQ3MaoPhKPTxNSrcvYdIFgaTWh1g6VhL7AE47vkwYhxDn0u9RiOLq0jBkTZNgOQJKdO3e4ct3HKBEBkmvVUFFPa5EFnLU3EtOYFM= Received: by 10.54.2.44 with SMTP id 44mr187148wrb; Fri, 08 Apr 2005 11:40:04 -0700 (PDT) Received: by 10.54.45.39 with HTTP; Fri, 8 Apr 2005 11:40:03 -0700 (PDT) Message-ID: Date: Fri, 8 Apr 2005 14:40:04 -0400 From: Vlad Reply-To: Vlad To: Brandon Metcalf Subject: Re: [Dbdpg-general] benchmarking old Pg and DBD::Pg Cc: dbdpg-general@gborg.postgresql.org, pgsql-interfaces@postgresql.org In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.261 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200504/31 X-Sequence-Number: 5447 > m> I don't know if developers of new DBD::Pg have some game plan to fix > m> this problem... but it won't be easy: since perl is a no-var-type > m> language, so either DBD::Pg needs to analyze the table columns data > m> types first before executing a query and then use correct type for > m> bind values, or let coder pass those types explicitly... though I'm > m> not aware of a method in DBI that would let them do that... > > Wouldn't bind_param() do just that? > just looked up DBI man - you are right, bind_param accepts column type... the question is - does DBD::Pg really process those types ? Checkout lines 1569 ... 1576 of dbdimp.c - it only checks BYTEAOID, everything else goes in as varchar :( While In other place ( line 1682) it analyzes the types... It's better to double check that with DBD::Pg developer, since I'm not familiar with its code deeply. Ideallly a programmer doesn't need to care to specify column type when putting a code like this (assuming C is of an "int" type ): my $sth = $dbh->prepare_cached( "select A from B where C=?"); $sth->execute( 123 ); ... and DBD::Pg would guess (don't ask me how) the column types and pass it to postgresql so the query executed in most efficient way. With DBD::Pg ver 1.40-1.41, if a programmer didn't specify a column type, it looks like it gonna be executed by postgresql w/o using indexes because of the bind values and table fields types conflict. -- Vlad