LAP - anchor table


What is exact definition of ANCHOR PROJECTION?  Its not clear from docs
Anchor Projection

An anchor projection is the physical storage for the anchor table data.

Before you create a live aggregate projection, you must create an anchor projection for the anchor table. The anchor projection's segmentation must be a subset of the live aggregate projection's segmentation. Each anchor table used for a live aggregate projection must have at least one anchor projection.

When you create a Top-K projection, the anchor table must have at least one projection that has the same PARTITION BY definition as in the CREATE PROJECTION statement. This projection is the anchor projection for the Top-K projection.

Sometimes I get after I created an anchor projection (I think that I created, but actually its not):
ROLLBACK 0:  Cannot create aggregate/top-k projection: no suitable anchor projection.
Group-by/Partition-by columns of aggregate/top-k projection must be in the same order as and include all the segmentation columns of the anchor projection.
Anchor projection must contain all columns of the aggregate/top-k projection.
Anchor projection must be segmented by hash in case of multinode database.
Anchor projection must be ksafe
So I can't understand what does it mean ANCHOR PROJECTION.


  • Options
    The anchor projection's segmentation must be a subset of the live aggregate projection's segmentation.
    If segmentation of anchor projection is SUBSET of LAP, so anchor projection actually is  a "subset" of LAP.  :(
  • Options
    Navin_CNavin_C Vertica Customer
    Hi Daniel,

    I too got confused with this first, but then I figured it out.
    Anchor Projection is nothing but the  a base projection for LAP with its rules on Segmentation columns and segmentation method.

    This really leaves us with with 3 copies of same data.
    A Super projection
    A Anchor Projection
    a Live Aggregate projection.


  • Options

    Thanks for response.
    What means "a base projection"? Same columns, same segmentation, same columns order but "pure" columns? Without any expression/group by, etc?

  • Options
    Docs are unclear:
    You cannot create a live aggregate projection that performs joins.
    but syntax of LAP, says:
    CREATE PROJECTION [ IF NOT EXISTS ]   ...[[db-name.]schema.]projection-name   ...[ ( { projection-column ...| {   GROUPED ( column-reference1, column-reference2 [ ,... ])}  ......... [ ACCESSRANK integer ]   ......... [ ENCODING Encoding-Type ] } [ ,... ] )  ...]  AS SELECT {table-columnexpr_with_columns } [ , ... ] FROM table-reference [ , ... ]  ... [ WHERE Join-Predicate [ AND join-predicate ] ...  ... [ GROUP BY expression ]  ... [ KSAFE [ k-num ] ]  
  • Options
    Finally located a problem - segmentation by modularhash when elastic cluster is enabled.

    Question can be closed.
    Thanks Navin for help.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file