Skip to main content
Question

Deleting unused projections

  • April 21, 2021
  • 2 replies
  • 9 views

yamakawa
Forum|alt.badge.img+1

Dear all

Thank you for your interest.

Currently, there are projections that are being notified as candidates for deletion by ManagementConsole.
They are TBL_pk_b0 and TBL_pk_b1 in the following table.
The following projections exist in the table.

projection_name anchor_table_name create_type is_super_projection is_key_constraint_projection segment_expression
TBL_pk_b0 TBL1 DELAYED CREATION f t hash(TBL1.COL1, TBL1.COL2)
TBL_pk_b1 TBL1 DELAYED CREATION f t hash(TBL1.COL1, TBL1.COL2)
TBL_DBD_212_seg_b0 TBL1 DESIGHER t f hash(TBL1.COL1, TBL1.COL2)
TBL_DBD_212_seg_b1 TBL1 DESIGHER t f hash(TBL1.COL1, TBL1.COL2)
TBL_DBD_2_seg_b0 TBL1 DESIGHER f f hash(TBL1.COL2)
TBL_DBD_2_seg_b1 TBL1 DESIGHER f f hash(TBL1.COL2)

Also, if you check v_catalog.projection_usage, there is no usage history for the projection in question.

Deleting it doesn't seem to be a problem.
I'd like to know if it's OK for the is_key_constraint_projection=true projection to no longer exist.

That's all, I'm looking forward to your answer.

2 replies

Vertica_Curtis
Forum|alt.badge.img+1
  • Participating Frequently
  • April 21, 2021

These types of projections exist because they are basis for enabled key constraints on the table. So, you've got a primary key constraint on the table, and it was set as "TRUE" for purposes of enforcing uniqueness, and this projection enforces the uniqueness of a PK constraint on that table. So, it's likely you might not be able to just drop this projection without also dropping the unique PK constraint on the table.


yamakawa
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • April 22, 2021

Dear Vertica_Curtis

Thank you for your answer.

I'm glad to know the information before I run the drop command.
Even if the projection is not being used, it is necessary for PK constraints, so I will leave the projection as it is.