Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 450241065D for ; Wed, 28 Aug 2013 11:01:32 +0000 (UTC) Received: (qmail 9063 invoked by uid 500); 28 Aug 2013 11:01:29 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 8969 invoked by uid 500); 28 Aug 2013 11:01:29 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 8960 invoked by uid 99); 28 Aug 2013 11:01:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Aug 2013 11:01:29 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [184.106.69.52] (HELO mailsrv.saicongames.com) (184.106.69.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Aug 2013 11:01:24 +0000 Received: from mailsrv.saicongames.com (localhost [127.0.0.1]) by mailsrv.saicongames.com (Postfix) with ESMTP id A891212A8D83 for ; Wed, 28 Aug 2013 14:01:03 +0300 (EEST) Received: from obelix.gt.local (unknown [217.69.7.30]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailsrv.saicongames.com (Postfix) with ESMTPSA id 13A5E12A9736 for ; Wed, 28 Aug 2013 14:01:02 +0300 (EEST) Message-ID: <521DD86D.8070903@iconplatforms.com> Date: Wed, 28 Aug 2013 14:01:01 +0300 From: Vassilis Bekiaris User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: user@cassandra.apache.org Subject: Re: CQL: Prepared statements References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------030008050300000706090509" 'X-AV-Checked: ClamAV using ClamSMTP' X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------030008050300000706090509 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, I think the introductory paragraphs in the Java Driver documentation [1] provide good justification on the use of prepared statements: " ... but you can also use prepared statements, which only need to be parsed once by the cluster, and then bind values to the variables and execute the bound statement you read or write data to a cluster. In the previous tutorial, you added a loadData method which creates a new statement for each INSERT, but you may also use prepared statements and bind new values to the columns each time before execution. Doing this increases performance, especially for repeated queries." Cheers! [1] http://www.datastax.com/documentation/developer/java-driver/1.0/webhelp/index.html#java-driver/quick_start/qsSimpleClientBoundStatements_t.html On 28/8/13 13:45 , Jorge Bay Gondra wrote: > Hi, > > I'm developing the Node.js CQL Driver > and I've just > finished implementing prepared statements through the binary protocol... > > I would like to provide driver users some guidance (use prepared > queries when X / use normal queries when Y): Is there any good user > documentation on prepared statements that I could point to? > > For me, I would recommend prepared statements because parameters are > binary encoded instead of being "stringified" as it happends while > executing a regular query. This is specially correct when dealing with > blobs and other binary data (blob bytes -> string -> bytes). > > Thanks, > J --------------030008050300000706090509 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Hi,

I think the introductory paragraphs in the Java Driver documentation [1] provide good justification on the use of prepared statements:

" ... but you can also use prepared statements, which only need to be parsed once by the cluster, and then bind values to the variables and execute the bound statement you read or write data to a cluster.

In the previous tutorial, you added a loadData method which creates a new statement for each INSERT, but you may also use prepared statements and bind new values to the columns each time before execution. Doing this increases performance, especially for repeated queries."

Cheers!

[1] http://www.datastax.com/documentation/developer/java-driver/1.0/webhelp/index.html#java-driver/quick_start/qsSimpleClientBoundStatements_t.html

On 28/8/13 13:45 , Jorge Bay Gondra wrote:
Hi,

I'm developing the Node.js CQL Driver and I've just finished implementing prepared statements through the binary protocol... 

I would like to provide driver users some guidance (use prepared queries when X / use normal queries when Y): Is there any good user documentation on prepared statements that I could point to?

For me, I would recommend prepared statements because parameters are binary encoded instead of being "stringified" as it happends while executing a regular query. This is specially correct when dealing with blobs and other binary data (blob bytes -> string -> bytes). 

Thanks,
J

--------------030008050300000706090509--