You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Xiangfei Ni <xi...@cm-dt.com> on 2018/05/28 06:34:06 UTC

答复: Re: cassandra update vs insert + delete

Yes, you are correct.

Best Regards,

倪项菲/ David Ni
中移德电网络科技有限公司
Virtue Intelligent Network Ltd, co.
Add: 2003,20F No.35 Luojia creative city,Luoyu Road,Wuhan,HuBei
Mob: +86 13797007811|Tel: + 86 27 5024 2516

发件人: onmstester onmstester <on...@zoho.com>
发送时间: 2018年5月28日 14:33
收件人: user <us...@cassandra.apache.org>
主题: Fwd: Re: cassandra update vs insert + delete

How update is working underneath?
Does it create a new row (because i'm changing a column of partition key) and add a tombstone to the old row?


Sent using Zoho Mail<https://www.zoho.com/mail/>


============ Forwarded message ============
From : Jonathan Haddad <jo...@jonhaddad.com>>
To : <us...@cassandra.apache.org>>
Date : Mon, 28 May 2018 00:07:36 +0430
Subject : Re: cassandra update vs insert + delete
============ Forwarded message ============

What is a “soft delete”?

My 2 cents, if you want to update some information just update it. There’s no need to overthink it.

Batches are good if they’re constrained to a single partition, not so hot otherwise.


On Sun, May 27, 2018 at 8:19 AM Rahul Singh <ra...@gmail.com>> wrote:

--
Jon Haddad
http://www.rustyrazorblade.com
twitter: rustyrazorblade
Deletes create tombstones — not really something to consider. Better to add / update or insert data and do a soft delete on old data and apply a TTL to remove it at a future time.

--
Rahul Singh
rahul.singh@anant.us<ma...@anant.us>

Anant Corporation

On May 27, 2018, 5:36 AM -0400, onmstester onmstester <on...@zoho.com>>, wrote:

Hi
I want to load all rows from many partitions and change a column value in each row, which of following ways is better concerning disk space and performance?
1. create a update statement for every row and batch update for each partitions
2. create an insert statement for every row and batch insert for each partition, then run a single statement to delete the whole old partition

Thanks in advance


Sent using Zoho Mail<https://www.zoho.com/mail/>




答复: 答复: Re: cassandra update vs insert + delete

Posted by Xiangfei Ni <xi...@cm-dt.com>.
It is not possible to update the primary key.

Best Regards,

倪项菲/ David Ni
中移德电网络科技有限公司
Virtue Intelligent Network Ltd, co.
Add: 2003,20F No.35 Luojia creative city,Luoyu Road,Wuhan,HuBei
Mob: +86 13797007811|Tel: + 86 27 5024 2516

发件人: onmstester onmstester <on...@zoho.com>
发送时间: 2018年5月28日 14:42
收件人: user <us...@cassandra.apache.org>
主题: Fwd: 答复: Re: cassandra update vs insert + delete

It seems that i can't update a part of primary key in cqlsh update:
message "PRIMARY Key part column found in SET part"


Sent using Zoho Mail<https://www.zoho.com/mail/>


============ Forwarded message ============
From : Xiangfei Ni <xi...@cm-dt.com>>
To : "user@cassandra.apache.org<ma...@cassandra.apache.org>>
Date : Mon, 28 May 2018 11:04:06 +0430
Subject : 答复: Re: cassandra update vs insert + delete
============ Forwarded message ============

Yes, you are correct.

Best Regards,

倪项菲/ David Ni
中移德电网络科技有限公司
Virtue Intelligent Network Ltd, co.
Add: 2003,20F No.35 Luojia creative city,Luoyu Road,Wuhan,HuBei
Mob: +86 13797007811|Tel: + 86 27 5024 2516

发件人: onmstester onmstester <on...@zoho.com>>
发送时间: 2018年5月28日 14:33
收件人: user <us...@cassandra.apache.org>>
主题: Fwd: Re: cassandra update vs insert + delete

How update is working underneath?
Does it create a new row (because i'm changing a column of partition key) and add a tombstone to the old row?


Sent using Zoho Mail<https://www.zoho.com/mail/>


============ Forwarded message ============
From : Jonathan Haddad <jo...@jonhaddad.com>>
To : <us...@cassandra.apache.org>>
Date : Mon, 28 May 2018 00:07:36 +0430
Subject : Re: cassandra update vs insert + delete
============ Forwarded message ============

What is a “soft delete”?

My 2 cents, if you want to update some information just update it. There’s no need to overthink it.

Batches are good if they’re constrained to a single partition, not so hot otherwise.


On Sun, May 27, 2018 at 8:19 AM Rahul Singh <ra...@gmail.com>> wrote:

--
Jon Haddad
http://www.rustyrazorblade.com
twitter: rustyrazorblade
Deletes create tombstones — not really something to consider. Better to add / update or insert data and do a soft delete on old data and apply a TTL to remove it at a future time.

--
Rahul Singh
rahul.singh@anant.us<ma...@anant.us>

Anant Corporation

On May 27, 2018, 5:36 AM -0400, onmstester onmstester <on...@zoho.com>>, wrote:

Hi
I want to load all rows from many partitions and change a column value in each row, which of following ways is better concerning disk space and performance?
1. create a update statement for every row and batch update for each partitions
2. create an insert statement for every row and batch insert for each partition, then run a single statement to delete the whole old partition

Thanks in advance


Sent using Zoho Mail<https://www.zoho.com/mail/>






Fwd: 答复: Re: cassandra update vs insert + delete

Posted by onmstester onmstester <on...@zoho.com>.
It seems that i can't update a part of primary key in cqlsh update:

message "PRIMARY Key part column found in SET part"


Sent using Zoho Mail






============ Forwarded message ============

From : Xiangfei Ni &lt;xiangfei.ni@cm-dt.com&gt;

To : "user@cassandra.apache.org"&lt;user@cassandra.apache.org&gt;

Date : Mon, 28 May 2018 11:04:06 +0430

Subject : 答复: Re: cassandra update vs insert + delete

============ Forwarded message ============




Yes, you are correct.

 

Best Regards,

 

倪项菲/ David Ni

中移德电网络科技有限公司

Virtue Intelligent Network Ltd, co.

Add: 2003,20F No.35 Luojia creative city,Luoyu Road,Wuhan,HuBei

Mob: +86 13797007811|Tel: + 86 27 5024 2516


 

发件人: onmstester onmstester &lt;onmstester@zoho.com&gt; 
 发送时间: 2018年5月28日 14:33
 收件人: user &lt;user@cassandra.apache.org&gt;
 主题: Fwd: Re: cassandra update vs insert + delete


 

How update is working underneath?


Does it create a new row (because i'm changing a column of partition key) and add a tombstone to the old row?


 


Sent using Zoho Mail


 


 


============ Forwarded message ============


From : Jonathan Haddad &lt;jon@jonhaddad.com&gt;


To : &lt;user@cassandra.apache.org&gt;


Date : Mon, 28 May 2018 00:07:36 +0430


Subject : Re: cassandra update vs insert + delete


============ Forwarded message ============



 


What is a “soft delete”? 


 


My 2 cents, if you want to update some information just update it. There’s no need to overthink it. 


 


Batches are good if they’re constrained to a single partition, not so hot otherwise. 


 


 


On Sun, May 27, 2018 at 8:19 AM Rahul Singh &lt;rahul.xavier.singh@gmail.com&gt; wrote:


 




--


Jon Haddad


http://www.rustyrazorblade.com


twitter: rustyrazorblade




Deletes create tombstones — not really something to consider. Better to add / update or insert data and do a soft delete on old data and apply a TTL to remove it at a future time.


 


--


Rahul Singh


rahul.singh@anant.us


 


Anant Corporation




 


On May 27, 2018, 5:36 AM -0400, onmstester onmstester &lt;onmstester@zoho.com&gt;, wrote:


 


Hi


I want to load all rows from many partitions and change a column value in each row, which of following ways is better concerning disk space and performance?


1. create a update statement for every row and batch update for each partitions


2. create an insert statement for every row and batch insert for each partition, then run a single statement to delete the whole old partition


 


Thanks in advance


 


Sent using Zoho Mail