incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vassilis Bekiaris <bekiar...@iconplatforms.com>
Subject Re: CQL: Prepared statements
Date Wed, 28 Aug 2013 11:01:01 GMT
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
> <https://github.com/jorgebay/node-cassandra-cql> 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


Mime
View raw message