How delete mechanism works on projections without the delete key on base table?

Moderator: NorbertKrupa

Post Reply
Fred
Newbie
Newbie
Posts: 11
Joined: Thu Sep 17, 2015 9:28 pm

How delete mechanism works on projections without the delete key on base table?

Post by Fred » Fri Sep 18, 2015 9:22 am

Hello,

I am wondering how does Vertica identify the records to be deleted from a projection if the projection does not have the column based on which the delete is performed on the underlying base table. Does anyone have any idea or does online documentation provide any explanation(if I missed it) as to how it works internally?

Thanks in advance for the insight.

Regards, Fred

NorbertKrupa
GURU
GURU
Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL
Contact:

Re: How delete mechanism works on projections without the delete key on base table?

Post by NorbertKrupa » Fri Sep 18, 2015 2:47 pm

Not sure if I understand. What do you mean by underlying base table?

There's stitching between the columns (not documented anywhere). A change to any column in a table would result in the entire row being marked for deletion on all projections for the table.
Checkout vertica.tips for more Vertica resources.

Fred
Newbie
Newbie
Posts: 11
Joined: Thu Sep 17, 2015 9:28 pm

Re: How delete mechanism works on projections without the delete key on base table?

Post by Fred » Fri Sep 18, 2015 6:43 pm

By base table, I meant simply the table on which the projections are built. Let me give an example. Please ignore any inconsistencies in the code in terms of syntax or performance point of view:

If my table structure is say something like this:

create table tbl
(
col1 number,
col2 number
)
segmented by hash(col1) all nodes ksafe 1;

and I have a custom projection something like:

create projection custom_proj
as
select col1
from tbl;

Now I perform a delete on the table like this:

delete from tbl where col2=<some value>.

Since the projection custom_proj does not have the col2, how does vertica know/identify the record to be deleted from the projection?

Thanks for your time.

-Fred.

NorbertKrupa
GURU
GURU
Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL
Contact:

Re: How delete mechanism works on projections without the delete key on base table?

Post by NorbertKrupa » Fri Sep 18, 2015 7:50 pm

Fred wrote:Since the projection custom_proj does not have the col2, how does vertica know/identify the record to be deleted from the projection?
Image
Checkout vertica.tips for more Vertica resources.

Post Reply

Return to “General”